<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 <title>493: Undecipherable</title>
 <link href="/atom.xml" rel="self"/>
 <link href="/"/>
 <updated>2026-05-10T11:33:35+02:00</updated>
 <id></id>
 <author>
   <name></name>
   <email></email>
 </author>
 
 <entry>
   <title>Presentation: Authentication for Web-Applications with OpenID Connect</title>
   <link href="/2023/09/presentation-openid-connect.html"/>
   <updated>2023-09-19T00:00:00+02:00</updated>
   <id>/2023/09/presentation-openid-connect</id>
   <content type="html">&lt;p&gt;I gave a presentation about OpenID Connect: how it works and why it is useful.&lt;/p&gt;

&lt;p&gt;Link to the (&lt;a href=&quot;/projects/2023-presentation-oidc/presentation.html&quot;&gt;presentation&lt;/a&gt;).&lt;/p&gt;

&lt;iframe src=&quot;/projects/2023-presentation-oidc/presentation.html&quot; height=&quot;400&quot; width=&quot;500&quot; style=&quot;margin-left: auto;margin-right: auto;display: block;&quot;&gt;&lt;/iframe&gt;

</content>
 </entry>
 
 <entry>
   <title>Presentation: Reviving open-source projects</title>
   <link href="/2022/12/presentation-reviving-open-source-projects.html"/>
   <updated>2022-12-30T00:00:00+01:00</updated>
   <id>/2022/12/presentation-revive</id>
   <content type="html">&lt;p&gt;I gave a short presentation at &lt;em&gt;Hacking in Parallel&lt;/em&gt; in Berlin about how to revive abandoned open-source projects.&lt;/p&gt;

&lt;p&gt;Abstract:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;Most open-source projects have limit lifetime: at some point in time development stops and the project becomes unmaintained. A lot of projects often do not even reach the stage, where they are used by a critical mass of users.
In this talk, I will go through the steps of continuing an open-source project using my lessons learned from forking Google&apos;s MyTracks and crafting it into OpenTracks.&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Link to the announcement: &lt;a href=&quot;https://pretalx.c3voc.de/hip-berlin-2022/talk/ZGJVPF/&quot;&gt;https://pretalx.c3voc.de/hip-berlin-2022/talk/ZGJVPF/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Link to the recording: will be published on &lt;a href=&quot;https://media.ccc.de&quot;&gt;media.ccc.de&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Link to the (&lt;a href=&quot;/projects/2022-presentation-revive/presentation.html&quot;&gt;presentation&lt;/a&gt;):&lt;/p&gt;

&lt;iframe src=&quot;/projects/2022-presentation-revive/presentation.html&quot; height=&quot;400&quot; width=&quot;500&quot; style=&quot;margin-left: auto;margin-right: auto;display: block;&quot;&gt;&lt;/iframe&gt;

</content>
 </entry>
 
 <entry>
   <title>GPS time rollover compensation for broken devices</title>
   <link href="/2020/12/gps-rollover.html"/>
   <updated>2020-12-22T00:00:00+01:00</updated>
   <id>/2020/12/gps-rollover-fix</id>
   <content type="html">&lt;p&gt;Every 19.7 years aka every 1024 weeks the week counter in GPS transmission has an overflow.
This is how to apply a fix if the hardware did not got a software update.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;    &lt;span class=&quot;cm&quot;&gt;/**
     * 1. Ancient fix for phones that do not set the time in {@link android.location.Location}.
     * 2. Fix for GPS time rollover happening every 19.7 years: https://en.wikipedia.org/wiki/GPS_Week_Number_Rollover
     */&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;fixTime&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;@NonNull&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Location&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;trackPoint&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;trackPoint&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getTime&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0L&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;nc&quot;&gt;Log&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;TAG&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Time of provided location was 0. Using current time.&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;trackPoint&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setTime&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;currentTimeMillis&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;());&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

        &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;kt&quot;&gt;long&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;timeDiff&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;abs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;trackPoint&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getTime&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;currentTimeMillis&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;());&lt;/span&gt;

            &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;timeDiff&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1023&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;UnitConversions&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;ONE_WEEK_MS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;nc&quot;&gt;Log&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;TAG&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;GPS week rollover.&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;trackPoint&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setTime&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;trackPoint&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getTime&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1024&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;UnitConversions&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;ONE_WEEK_MS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

</content>
 </entry>
 
 <entry>
   <title>Office of Strategic Services: Simple Sabotage Field Manual</title>
   <link href="/2019/10/oss-sabotage-manual.html"/>
   <updated>2019-10-01T00:00:00+02:00</updated>
   <id>/2019/10/oss-simple-sabotage-manual</id>
   <content type="html">&lt;p&gt;Some years ago, a friend of mine showed me the &lt;a href=&quot;https://www.cia.gov/news-information/featured-story-archive/2012-featured-story-archive/CleanedUOSSSimpleSabotage_sm.pdf&quot;&gt;Simple Sabotage Field Manual&lt;/a&gt;.
This document was created by the &lt;em&gt;Office of Strategic Services&lt;/em&gt; (predecessor of the &lt;a href=&quot;https://en.wikipedia.org/wiki/Central_Intelligence_Agency&quot;&gt;CIA&lt;/a&gt;) in January 1944 to prepare a successful &lt;a href=&quot;https://en.wikipedia.org/wiki/Normandy_landings&quot;&gt;D-Day&lt;/a&gt;.
It contains some really interesting recommendations how to slow down and obstruct within organisations (incl. companies), and these are really practical (and well used).&lt;/p&gt;

&lt;p&gt;Recently, created a presentation about it (&lt;a href=&quot;/projects/oss-sabotage-manual/presentation.html&quot;&gt;presentation&lt;/a&gt;):&lt;/p&gt;

&lt;iframe src=&quot;/projects/oss-sabotage-manual/presentation.html&quot; height=&quot;400&quot; width=&quot;500&quot; style=&quot;margin-left: auto;margin-right: auto;display: block;&quot;&gt;&lt;/iframe&gt;

</content>
 </entry>
 
 <entry>
   <title>Android&apos;s ContentProvider: how to share a virtual file</title>
   <link href="/2019/08/android-content-provider.html"/>
   <updated>2019-08-25T00:00:00+02:00</updated>
   <id>/2019/08/contentprovider</id>
   <content type="html">&lt;p&gt;While working on &lt;a href=&quot;https://github.com/dennisguse/opentracks&quot;&gt;OpenTracks&lt;/a&gt;, I wanted to send &lt;em&gt;geographical data&lt;/em&gt; (e.g., points as well as KML, GPX) to another installed application that could show this kind of data (e.g., &lt;a href=&quot;https://osmand.net/&quot;&gt;OsmAnd&lt;/a&gt; or &lt;a href=&quot;https://maps.me/&quot;&gt;Maps.ME&lt;/a&gt;).
The main reason for this, was that I did not want this functionality in OpenTracks as it was not a core feature.&lt;/p&gt;

&lt;p&gt;To achieve this usually, the &lt;a href=&quot;https://developer.android.com/reference/androidx/core/content/FileProvider&quot;&gt;FileProvider&lt;/a&gt; is used and it’s usage is really simple: just get the Uri of the file to be shared and send an intent (be aware of grantUriPermission).
This is awesome as long as the file is already stored on the device - it is painless simple.&lt;/p&gt;

&lt;p&gt;However, what happens if the data is not yet stored in the file system?
For example, the data resides in a SQLite database?
This is actually achivable using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;FileProvider&lt;/code&gt;:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;One could store the data in a temporary file and store it somewhere (e.g., the app’s &lt;a href=&quot;https://developer.android.com/training/data-storage/files.html#WriteCacheFileInternal&quot;&gt;cache directory&lt;/a&gt;).&lt;/li&gt;
  &lt;li&gt;Send the intent.&lt;/li&gt;
  &lt;li&gt;Later delete the temporary file.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This solution works quite well and is probably in use quite often.
However, it does not feel very beautiful (at least not for me).&lt;/p&gt;

&lt;p&gt;What I actually wanted was the a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ContentProvider&lt;/code&gt; that can share a virtual (i.e., file is created on the fly from database).
Thus, I do not need to create the temporary file and delete it later.
Luckily, this is possible and this is actually quite straight forward.
The following shows an example that is inspired by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;FileProvider&lt;/code&gt;, but the interesting part is in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;openFile()&lt;/code&gt; and how a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ParcelFileDescriptor&lt;/code&gt; can be created without an actual file.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ShareContentProvider&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ContentProvider&lt;/span&gt;

    &lt;span class=&quot;kd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;COLUMNS&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;OpenableColumns&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;DISPLAY_NAME&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;OpenableColumns&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;SIZE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;};&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;//Provide file name and size.&lt;/span&gt;
    &lt;span class=&quot;nd&quot;&gt;@Override&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Cursor&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;query&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;@NonNull&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Uri&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;uri&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nd&quot;&gt;@Nullable&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;projection&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nd&quot;&gt;@Nullable&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;selection&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nd&quot;&gt;@Nullable&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;selectionArgs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nd&quot;&gt;@Nullable&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sortOrder&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;// Inspired from FileProvider&lt;/span&gt;
        &lt;span class=&quot;c1&quot;&gt;// ContentProvider has already checked granted permissions&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;projection&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;projection&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;COLUMNS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

        &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cols&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;projection&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;];&lt;/span&gt;
        &lt;span class=&quot;nc&quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;values&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;projection&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;];&lt;/span&gt;
        &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;col&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;projection&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;OpenableColumns&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;DISPLAY_NAME&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;equals&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;col&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;cols&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;OpenableColumns&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;DISPLAY_NAME&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;values&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;uri&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getLastPathSegment&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
            &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;OpenableColumns&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;SIZE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;equals&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;col&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;cols&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;OpenableColumns&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;SIZE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;values&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//Return a file size of -1&lt;/span&gt;
            &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

        &lt;span class=&quot;n&quot;&gt;cols&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Arrays&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;copyOf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cols&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;values&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Arrays&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;copyOf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;values&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;

        &lt;span class=&quot;kd&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;MatrixCursor&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cursor&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;MatrixCursor&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cols&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;addRow&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;values&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;nd&quot;&gt;@Nullable&lt;/span&gt;
    &lt;span class=&quot;nd&quot;&gt;@Override&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;getType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;@NonNull&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Uri&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;uri&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;PutYourMimeTypeHere&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;nd&quot;&gt;@Nullable&lt;/span&gt;
    &lt;span class=&quot;nd&quot;&gt;@Override&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ParcelFileDescriptor&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;openFile&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;@NonNull&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Uri&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;uri&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nd&quot;&gt;@NonNull&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;throws&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;FileNotFoundException&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nc&quot;&gt;PipeDataWriter&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pipeDataWriter&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;PipeDataWriter&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;nd&quot;&gt;@Override&lt;/span&gt;
            &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;writeDataToPipe&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;@NonNull&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ParcelFileDescriptor&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;output&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nd&quot;&gt;@NonNull&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Uri&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;uri&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nd&quot;&gt;@NonNull&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;mimeType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nd&quot;&gt;@Nullable&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Bundle&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;opts&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nd&quot;&gt;@Nullable&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;k&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;FileOutputStream&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fileOutputStream&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;FileOutputStream&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;output&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getFileDescriptor&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()))&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
                     &lt;span class=&quot;c1&quot;&gt;//TODO: Write your actual data&lt;/span&gt;
                     &lt;span class=&quot;kt&quot;&gt;byte&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[]&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;byte&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[]{&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;};&lt;/span&gt;
                     &lt;span class=&quot;n&quot;&gt;fileOutputStream&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
                &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;IOException&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
                    &lt;span class=&quot;nc&quot;&gt;Log&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;TAG&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;there occurred an error while sharing a file: &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
                &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;};&lt;/span&gt;

        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;openPipeHelper&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;uri&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;getType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;uri&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pipeDataWriter&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The full code is available on &lt;a href=&quot;https://github.com/dennisguse/OpenTracks/blob/3a7562d96cba96246d8406084f79fd41e0dad7eb/src/main/java/de/dennisguse/opentracks/content/ShareContentProvider.java&quot;&gt;Github&lt;/a&gt;.
In addition, please be aware to make the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ShareContentProvider&lt;/code&gt; accessible to the calling app (i.e., grantUriPermission).&lt;/p&gt;

&lt;p&gt;For OpenTracks, I ran, however, into another issue related to Android’s security.
OpenTracks uses internally a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ContentProvider&lt;/code&gt; that manages access to the internal SQLite database.
My initial approach was to implemented the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ShareContentProvider&lt;/code&gt; and let it forward requests to the internal &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ContentProvider&lt;/code&gt; (i.e., two separate instances), but both belonging to OpenTracks.
In &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ShareContentProvider&lt;/code&gt;, I used &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;getContext().getContentResolver()&lt;/code&gt; to access the internal &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ContentProvider&lt;/code&gt;.
This works quite well.
However, if &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ShareContentProvider&lt;/code&gt; receives a request from another app (access granted via temporary grantUriPermission), Android’s security infrastructure does not allow to forward requests to the internal &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ContentProvider&lt;/code&gt;.
The reason is rather simple as the calling app only got permission for one URI managed &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ShareContentProvider&lt;/code&gt; and not for the internal &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ContentProvider&lt;/code&gt; URIs.
One (im)possible solution would be to make the internal &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ContentProvder&lt;/code&gt; to be world readable (i.e., &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;exported=&quot;true&quot;&lt;/code&gt;), but this would expose all data of your app to all other installed apps.
And this is an absolute no go!&lt;/p&gt;

&lt;p&gt;I solved this issue by using only one &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ContentProvider&lt;/code&gt; for OpenTracks (i.e., merging &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ShareContentProvider&lt;/code&gt; and the internal &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ContentProvider&lt;/code&gt;).
The resulting &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ContentProvider&lt;/code&gt; can then use himself to acquire the necessary data for file sharing URIs.
The implementation is rather simple as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ShareContentProvider&lt;/code&gt; inherits from the internal &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ContentProvider&lt;/code&gt; and forwards all internal requests to it’s parent.
For convenience, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ShareContentProvider&lt;/code&gt; has a static function to create a sharing URI as it later needs to parse the URI again.&lt;/p&gt;

&lt;p&gt;OpenTracks can now share geo-data files with other map application without using temporary files.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Releasing OpenTracks</title>
   <link href="/2019/08/android-opentracks.html"/>
   <updated>2019-08-24T00:00:00+02:00</updated>
   <id>/2019/08/opentracks</id>
   <content type="html">&lt;p&gt;Some years ago, I was a happy user of &lt;a href=&quot;https://en.wikipedia.org/wiki/MyTracks&quot;&gt;Google’s MyTracks&lt;/a&gt;.
It was a great application to track your sport and outdoor activities.
The feature (I rarely used) I liked the most was that you could take pictures and these were included in the tracks.
However, in 2016 Google decided to stop working on &lt;em&gt;MyTracks&lt;/em&gt; and also removed it from the Play Store.
Gladly, the source code of &lt;em&gt;MyTracks&lt;/em&gt; was released as Open Source (Apache 2.0 license) and thus, theoretical, could be maintained further.
However, nothing happened so far and while looking for a new spare-time project, I decided to revamp MyTracks.
For me, it was and will be an interesting endeavour on restoring a fully matured Android application while adding/changin/removing features while keeping it maintainable.&lt;/p&gt;

&lt;p&gt;The revamped version is now released as &lt;a href=&quot;https://github.com/dennisguse/opentracks&quot;&gt;OpenTracks&lt;/a&gt;.
OpenTracks will project vision is rather simple: &lt;em&gt;privacy first, features second&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Following, this vision OpenTracks will not include functionality that will require Internet access.
This also includes features like showing a recorded track on map.&lt;/p&gt;

&lt;p&gt;Source code: &lt;a href=&quot;https://github.com/dennisguse/opentracks&quot;&gt;Github&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>SQLServer STContains() performance</title>
   <link href="/2018/06/sqlserver-stcontains.html"/>
   <updated>2018-06-06T00:00:00+02:00</updated>
   <id>/2018/06/sqlserver-geo-stcontains</id>
   <content type="html">&lt;p&gt;For some reason SQLServer 2017 is picky with regard to performance for geography comparisons.&lt;/p&gt;

&lt;p&gt;The first statement seems is rather slow (seems to ignore spatial indeces) while the second one works &lt;strong&gt;impressively&lt;/strong&gt; fast on my data.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sql&quot; data-lang=&quot;sql&quot;&gt;&lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;MyGeodata&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;MyGeoData&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SHAPE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;STContains&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;MyGeoData&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;POINT&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sql&quot; data-lang=&quot;sql&quot;&gt;&lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;MyGeodata&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;MyGeoData&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SHAPE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;STContains&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;MyGeoData&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;POINT&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; I would prefer the first variant as technically NOT(False) is TRUE and TRUE is everything except 0.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>SQLServer SQL to GeoJSON</title>
   <link href="/2018/05/sqlserver-to-geojson.html"/>
   <updated>2018-05-20T00:00:00+02:00</updated>
   <id>/2018/05/sqlserver-geojson</id>
   <content type="html">&lt;p&gt;Export GeoJSON via SQL from SQLServer.
Based on &lt;a href=&quot;https://blogs.msdn.microsoft.com/sqlserverstorageengine/2016/01/05/loading-geojson-data-into-sql-server/]&quot;&gt;this blog post on MSDN&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For export directly to a file this powershell script might be helpful: &lt;a href=&quot;https://github.com/dennisguse/powershell-scripts/blob/master/sqlserver-cmd-to-file.ps1&quot;&gt;sqlserver-cmd-to-file.ps1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; I observed (not yet solved) issues, when I tried to export more than 1600 items.
Seemed like a “this string is too long” problem.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sql&quot; data-lang=&quot;sql&quot;&gt;&lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; 
&lt;span class=&quot;c1&quot;&gt;--GeoJSON Header&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;CONCAT&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;{ &quot;type&quot;: &quot;FeatureCollection&quot;, &quot;features&quot;:&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; 
&lt;span class=&quot;c1&quot;&gt;--Select POINTS&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt;
     &lt;span class=&quot;s1&quot;&gt;&apos;Feature&apos;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;AS&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
     &lt;span class=&quot;s1&quot;&gt;&apos;Point&apos;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;AS&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;geometry&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
     &lt;span class=&quot;n&quot;&gt;JSON_QUERY&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;FORMATMESSAGE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;[%s,%s]&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;FORMAT&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;yourX&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;N&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;0.##################################################&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;FORMAT&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;yourY&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;N&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&apos;0.##################################################&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
     &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;AS&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;geometry&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;coordinates&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;PutYourTableHere&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;FOR&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;JSON&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;PATH&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; 
&lt;span class=&quot;c1&quot;&gt;--Close JSON HashMap&lt;/span&gt;
  &lt;span class=&quot;s1&quot;&gt;&apos;}&apos;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

</content>
 </entry>
 
 <entry>
   <title>Downloading data from a webpage with login </title>
   <link href="/2017/12/downloading-data-from-webpage.html"/>
   <updated>2017-12-18T00:00:00+01:00</updated>
   <id>/2017/12/downloading-data-from-protected-webpages</id>
   <content type="html">&lt;p&gt;Usually, downloading data from a webpage is straight forward.
Just use your favorite tool and go (such as wget or curl).
Sometimes, however, it is not that simple - especially if the webpage requires a login (this means not sending credentials as part of the URL).&lt;/p&gt;

&lt;p&gt;The following code does a login and then downloads a webpage from such a webpage.
It uses &lt;a href=&quot;http://phantomjs.org/&quot;&gt;PhantomJS&lt;/a&gt;.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;page&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;webpage&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;create&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;onResourceReceived&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;response&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//  console.log(&apos;Response (#&apos; + response.id + &apos;, stage &quot;&apos; + response.stage + &apos;&quot;): &apos; + JSON.stringify(response));&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;//Start process: Login&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;https://LOGIN-URL&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;status&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!==&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;success&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Unable to access network&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;phantom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;exit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;//Set handler for the follow-up of the login request.&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;onLoadFinished&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;downloadData&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;nx&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;evaluate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
       &lt;span class=&quot;c1&quot;&gt;//Set credentials&lt;/span&gt;
       &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;USERNAME&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;value&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;USERNAME&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
       &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;PASSWORD&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;PASSWORD&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
       &lt;span class=&quot;c1&quot;&gt;//Trigger login request&lt;/span&gt;
       &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;Login&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;    
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;downloadData&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

  &lt;span class=&quot;nx&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;onLoadFinished&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;undefined&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;//Download data&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;https://DATA-URL&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;page&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;phantom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;exit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

</content>
 </entry>
 
 <entry>
   <title>Mathematica 11.1: Issue parsing German characters using ImportString[]</title>
   <link href="/2017/09/mathematica-importstring.html"/>
   <updated>2017-09-19T00:00:00+02:00</updated>
   <id>/2017/09/mathematica-import-string</id>
   <content type="html">&lt;p&gt;German characters in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ImportString[data, &quot;RawJSON&quot;]&lt;/code&gt; break during parsing.
A string containing the German character “ß” (also tested “ä”) will be broken, ie., the letter as well as the following letters are not correct.&lt;/p&gt;

&lt;p&gt;Affects &lt;a href=&quot;https://www.wolfram.com/mathematica/&quot;&gt;Mathematica 11.1&lt;/a&gt;.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ImportString[&quot;{\&quot;test1\&quot;:\&quot;ABCäABC\&quot;,\&quot;test2\&quot;:\&quot;ABCßABC\&quot;}&quot;, &quot;RawJSON&quot;]
&amp;lt;|&quot;test1&quot; -&amp;gt; &quot;ABC。C&quot;, &quot;test2&quot; -&amp;gt; &quot;ABCށBC&quot;|&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This also remains using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Export[]&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Workaround: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Association = ImportString[SOMTHING, &quot;JSON&quot;]&lt;/code&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>SeaBIOS on Libreboot via Grub2</title>
   <link href="/2016/11/seabios-on-libreboot.html"/>
   <updated>2016-11-20T00:00:00+01:00</updated>
   <id>/2016/11/seabios-on-libreboot</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;https://libreboot.org/&quot;&gt;Libreboot&lt;/a&gt; mainly offers &lt;a href=&quot;https://www.gnu.org/software/grub/&quot;&gt;Grub2&lt;/a&gt; as payload (at least for Lenovo X60).
That’s quite nice and often sufficient as one can start Linux.&lt;/p&gt;

&lt;p&gt;The default startup procedure of Libreboot is first start a deblobbed &lt;a href=&quot;https://www.coreboot.org/&quot;&gt;coreboot&lt;/a&gt;, which then loads Grub2.
Coreboot, Grub2, and all configuration are flashed to the bios chip.
This ROM is actually a large binary blob, which includes the &lt;a href=&quot;https://lennartb.home.xs4all.nl/coreboot/col5.html&quot;&gt;Coreboot File System (CBFS)&lt;/a&gt;.
During the boot process, coreboot loads the CBFS from the bios chip into the RAM.
So, every subsequent &lt;a href=&quot;https://en.wikipedia.org/wiki/Booting&quot;&gt;bootloader&lt;/a&gt; can access this file system to load configuration files or even load subsequent bootloaders.&lt;/p&gt;

&lt;p&gt;On my Lenovo X60, I now wanted to have the following start procedure: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;coreboot -&amp;gt; Grub2 -&amp;gt; SeaBIOS&lt;/code&gt;.
The simplest solution would be to just add the SeaBIOS ROM to the CBFS and flash the new CBFS (e.g., &lt;a href=&quot;https://github.com/bibanon/Coreboot-ThinkPads/blob/master/Libreboot-Mods/Libreboot-GRUB2.md&quot;&gt;here&lt;/a&gt;).
However, I don’t like the risky procedure of flashing my hardware and potentially bricking it (Lenovo X60 with 64bit C2D are really rare).&lt;/p&gt;

&lt;p&gt;This can be easily solved by using Grub2’s capability to access harddrives.
Thus, SeaBIOS can be loaded from Grub2 (using a USB thumbdrive):&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;chainloader (usb0,msdos1)/bios.bin.elf
boot
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This works, but as the VGA-rom is not available only debug output via serial port if configured will be shown (e.g., &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;screen /dev/ttyUSB0 115200&lt;/code&gt;).
For VGA support, the &lt;a href=&quot;https://www.seabios.org/SeaVGABIOS&quot;&gt;SeaVGABIOS&lt;/a&gt; needs to be findable by SeaBIOS.
If SeaBIOS was compiled with CBFS support, it could be put into the CBFS and flash it - not an option for me.&lt;/p&gt;

&lt;p&gt;I asked on the &lt;a href=&quot;https://www.coreboot.org/pipermail/seabios/2016-November/011014.html&quot;&gt;SeaBIOS mailing list&lt;/a&gt;, and Kevin O’Connor told me that SeaBIOS supports &lt;a href=&quot;http://wiki.osdev.org/Multiboot&quot;&gt;multiboot&lt;/a&gt; (recently implemented by &lt;a href=&quot;https://www.coreboot.org/pipermail/seabios/2015-May/009170.html&quot;&gt;Vladimir Serbinenko&lt;/a&gt;).&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;multiboot &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;usb0,msdos1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;/bios.elf.bin
module &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;usb0,msdos1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;/vgabios.bin &lt;span class=&quot;nv&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;vgaroms/seavgabios.bin
boot
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This works like charm and configuration files for SeaBIOS can be provided using this approach.&lt;/p&gt;

&lt;p&gt;How I build SeaBIOS with VGA support for the Lenovo X60:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git clone git://git.seabios.org/seabios.git&lt;/code&gt; (commit-id: d7adf6044a4c772b497e97272adf97426b34a249)&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;make menuconfig&lt;/code&gt; (all other options default)&lt;/li&gt;
  &lt;li&gt;General Features -&amp;gt; Build target: &lt;strong&gt;coreboot&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;General Features -&amp;gt; coreboot CBFS support: &lt;strong&gt;disabled&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;VGA ROM -&amp;gt; VGA Hardware Type: &lt;strong&gt;coreboot linear framebuffer&lt;/strong&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;make&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Please note that CBFS support should be &lt;em&gt;disabled&lt;/em&gt;, because coreboot loaded a CBFS.
Thus, SeaBIOS might also use CBFS provided ROMs and also other bootloaders (such as the provided Grub2).&lt;/p&gt;

&lt;p&gt;This works like charm: even a Windows 10 installer &lt;em&gt;start&lt;/em&gt; loading (but is not functional).&lt;/p&gt;

&lt;p&gt;Tiny issue as of today: the keyboard of my X60 works in Grub2, but for SeaBIOS I needed to use a external USB keyboard.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>8Bitdo: udev rules for game controller</title>
   <link href="/2016/07/8bitdo-udev.html"/>
   <updated>2016-07-06T11:00:00+02:00</updated>
   <id>/2016/07/8bitdo-udev</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;http://www.8bitdo.com/&quot;&gt;8bitdo&lt;/a&gt; sells some really nice game controllers featuring USB as well as Bluetooth such as &lt;a href=&quot;http://www.8bitdo.com/snes30/&quot;&gt;SNES30&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;At least on Ubuntu, I needed to install custom udev-rules.
Otherwise the controller is only recognized as keyboard with &lt;em&gt;four&lt;/em&gt; keys.&lt;/p&gt;

&lt;p&gt;The following udev-rules were taken from the &lt;a href=&quot;https://raw.githubusercontent.com/paalfe/mixedcontent/master/udev_rules.d/99-8bitdo-bluetooth-controllers.rules&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;# If applications do NOT detect the 8Bitdo controller when connected via Bluetooth and won&apos;t even recognize manual binding, 
# fix this by adding these udev rules to force detection - https://github.com/paalfe/mixedcontent/blob/master/udev_rules.d/99-8bitdo-bluetooth-controllers.rules. 
# Add the udev rules file to &quot;/etc/udev/rules.d/99-8bitdo-bluetooth-controllers.rules&quot; and reboot. 
# Forum thread: http://libretro.com/forums/showthread.php?t=3649 
# Useful reading: https://hg.libsdl.org/SDL/file/704a0bfecf75/README-linux.txt

# 8Bitdo FC30 1P GamePad Bluetooth mode(START) mode(START+R)
SUBSYSTEM==&quot;input&quot;, ATTRS{name}==&quot;8Bitdo FC30 GamePad&quot;, MODE=&quot;0666&quot;, ENV{ID_INPUT_JOYSTICK}=&quot;1&quot;

# 8Bitdo FC30 2P GamePad Bluetooth mode(START)
SUBSYSTEM==&quot;input&quot;, ATTRS{name}==&quot;8Bitdo FC30 II&quot;, MODE=&quot;0666&quot;, ENV{ID_INPUT_JOYSTICK}=&quot;1&quot; 

# 8Bitdo FC30 2P GamePad Bluetooth mode(START+R)
SUBSYSTEM==&quot;input&quot;, ATTRS{name}==&quot;8Bitdo FC30 II Joystick&quot;, MODE=&quot;0666&quot;, ENV{ID_INPUT_JOYSTICK}=&quot;1&quot;

# 8Bitdo SFC30 GamePad Bluetooth mode(START)
SUBSYSTEM==&quot;input&quot;, ATTRS{name}==&quot;8Bitdo SFC30 GamePad&quot;, MODE=&quot;0666&quot;, ENV{ID_INPUT_JOYSTICK}=&quot;1&quot;

# 8Bitdo SFC30 GamePad Bluetooth mode(START+R)
SUBSYSTEM==&quot;input&quot;, ATTRS{name}==&quot;8Bitdo SFC30 GamePad Joystick&quot;, MODE=&quot;0666&quot;, ENV{ID_INPUT_JOYSTICK}=&quot;1&quot;

# 8Bitdo NES30 GamePad Bluetooth mode(START)
SUBSYSTEM==&quot;input&quot;, ATTRS{name}==&quot;8Bitdo NES30 GamePad&quot;, MODE=&quot;0666&quot;, ENV{ID_INPUT_JOYSTICK}=&quot;1&quot;

# 8Bitdo NES30 GamePad Bluetooth mode(START+R)
SUBSYSTEM==&quot;input&quot;, ATTRS{name}==&quot;8Bitdo NES30 GamePad Joystick&quot;, MODE=&quot;0666&quot;, ENV{ID_INPUT_JOYSTICK}=&quot;1&quot;

# 8Bitdo SNES30 GamePad Bluetooth mode(START)
SUBSYSTEM==&quot;input&quot;, ATTRS{name}==&quot;8Bitdo SNES30 GamePad&quot;, MODE=&quot;0666&quot;, ENV{ID_INPUT_JOYSTICK}=&quot;1&quot;

# 8Bitdo SNES30 GamePad Bluetooth mode(START+R)
SUBSYSTEM==&quot;input&quot;, ATTRS{name}==&quot;8Bitdo SNES30 GamePad Joystick&quot;, MODE=&quot;0666&quot;, ENV{ID_INPUT_JOYSTICK}=&quot;1&quot;

# 8Bitdo FC30 Pro GamePad Bluetooth mode(POWER) mode(POWER+R1)
SUBSYSTEM==&quot;input&quot;, ATTRS{name}==&quot;8Bitdo FC30 Pro&quot;, MODE=&quot;0666&quot;, ENV{ID_INPUT_JOYSTICK}=&quot;1&quot;

# 8Bitdo NES30 Pro GamePad Bluetooth mode(POWER)
SUBSYSTEM==&quot;input&quot;, ATTRS{name}==&quot;8Bitdo NES30 Pro&quot;, MODE=&quot;0666&quot;, ENV{ID_INPUT_JOYSTICK}=&quot;1&quot;

# 8Bitdo NES30 Pro GamePad Bluetooth mode(POWER+R1)
SUBSYSTEM==&quot;input&quot;, ATTRS{name}==&quot;8Bitdo NES30 Pro Joystick&quot;, MODE=&quot;0666&quot;, ENV{ID_INPUT_JOYSTICK}=&quot;1&quot;

# 8Bitdo FC30 Arcade Joystick Bluetooth mode(HOME)
SUBSYSTEM==&quot;input&quot;, ATTRS{name}==&quot;8Bitdo Joy&quot;, MODE=&quot;0666&quot;, ENV{ID_INPUT_JOYSTICK}=&quot;1&quot;

# 8Bitdo Zero GamePad Bluetooth mode(START) mode(START+R)
SUBSYSTEM==&quot;input&quot;, ATTRS{name}==&quot;8Bitdo Zero GamePad&quot;, MODE=&quot;0666&quot;, ENV{ID_INPUT_JOYSTICK}=&quot;1&quot;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

</content>
 </entry>
 
 <entry>
   <title>Asterisk: Conferencing Server with LUA</title>
   <link href="/2016/05/asterisk-lua-conferencing.html"/>
   <updated>2016-05-29T12:00:00+02:00</updated>
   <id>/2016/05/asterisk-lua-conferencing</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;http://http://www.asterisk.org/&quot;&gt;Asterisk&lt;/a&gt; is a powerful telephone server.
However, its configuration via &lt;em&gt;extensions.conf&lt;/em&gt; is a little bit annoying, if you would really like to &lt;em&gt;program&lt;/em&gt; your dialplan (e.g., if-then-else, read a file, execute some command line program, …).
The diaplan can also be implemented using &lt;a href=&quot;https://en.wikipedia.org/wiki/Lua_(programming_language)&quot;&gt;LUA&lt;/a&gt;: &lt;em&gt;extensions.lua&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Here, is a short demo setup for a telephone conference server that is reachable via &lt;em&gt;telephone number&lt;/em&gt; using &lt;a href=&quot;http://www.sipgate.de/&quot;&gt;sipgate.de&lt;/a&gt; and a lua-based dialplan.&lt;/p&gt;

&lt;p&gt;The server registers at &lt;a href=&quot;http://www.sipgate.de/&quot;&gt;sipgate.de&lt;/a&gt;, who provide a telephone number for the server.
All incoming calls at the server are forward to a telephone conference room.&lt;/p&gt;

&lt;p&gt;I used this setup from Asterisk 11 until Asterisk 13 running on a &lt;em&gt;FreeBSD 10.X&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;sip.conf:&lt;/em&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ini&quot; data-lang=&quot;ini&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;nn&quot;&gt;[general]&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;allowguest&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;no&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;alwaysauthreject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;yes&lt;/span&gt;

&lt;span class=&quot;py&quot;&gt;canreinvite&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;no&lt;/span&gt;

&lt;span class=&quot;py&quot;&gt;disallow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;allow&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;allow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;g711&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;;SIPGATE This is the incoming uplink
&lt;/span&gt;&lt;span class=&quot;py&quot;&gt;register&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;gt; USERNAME:PASSWORD@sipgate.de/USERNAME&lt;/span&gt;

&lt;span class=&quot;nn&quot;&gt;[trunk_incoming]&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;peer&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;host&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;sipgate.de&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;context&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;trunk_incoming&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;&lt;em&gt;extensions.lua:&lt;/em&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-lua&quot; data-lang=&quot;lua&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;n&quot;&gt;extensions&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{}&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;extensions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;trunk_incoming&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;_X&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
	&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;playback&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;beep&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
	
	&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;room&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;conf-getconfno&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
	&lt;span class=&quot;n&quot;&gt;room&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;channel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;room&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;room&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;nil&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;then&lt;/span&gt;
	    &lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;playback&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;beepErr&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
	    &lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;hangup&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
	&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

	&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;verbose&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Conference room &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;..&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;room&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;..&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;: &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;..&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;channel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;CALLERID&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;num&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;..&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot; entered&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
	&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;playback&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;conf-enteringno&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
	&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sayDigits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;room&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;f&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
	
	&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;confBridge&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;room&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;NOTE: Asterisk does not reload the &lt;em&gt;extensions.lua&lt;/em&gt; automatically even not using &lt;em&gt;core reload&lt;/em&gt;.
After configuration changes the module must be reloaded: &lt;em&gt;module reload pbx_lua.so&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;NOTE: The LUA-parser in &lt;a href=&quot;http://http://www.asterisk.org/&quot;&gt;Asterisk&lt;/a&gt; is very nitty-gritty.
Be careful about using only spaces and align the code properly.&lt;/p&gt;

&lt;p&gt;NOTE: The traffic is not encrypted.
Take care of it yourself by setting up a IPSec-tunnel!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Panasonic KX-2123 with KX-PT10</title>
   <link href="/2016/03/kx-2123.html"/>
   <updated>2016-03-19T12:00:00+01:00</updated>
   <id>/2016/03/kx2123</id>
   <content type="html">&lt;p&gt;Still working like a boss: just got a 20 year old dot-matrix printer.&lt;/p&gt;

&lt;p&gt;It is a Panasonic KX-2123 with an additional cut sheet feeder KX-PT10.&lt;/p&gt;

&lt;video src=&quot;/images/2016/03/kx-2123.html/VIDEO0004.m4v&quot; style=&quot;width:100%&quot; controls=&quot;&quot;&gt;&lt;/video&gt;
</content>
 </entry>
 
 <entry>
   <title>Pitfalls in SVG Positioning</title>
   <link href="/2015/11/svg-positioning.html"/>
   <updated>2015-11-07T12:00:00+01:00</updated>
   <id>/2015/11/svg-positioning</id>
   <content type="html">&lt;p&gt;&lt;em&gt;_Update_: SVGGraphicsElement.getTransformToElement() was &lt;a href=&quot;https://lists.w3.org/Archives/Public/www-svg/2015Aug/att-0009/SVGWG-F2F-minutes-20150824.html#item02&quot;&gt;removed&lt;/a&gt; from the current draft.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In difference to pixel-based images formats, like JPEG or PNG, do &lt;a href=&quot;https://en.wikipedia.org/wiki/Scalable_Vector_Graphics&quot;&gt;SVG&lt;/a&gt; images allow to add animations, can be programmed and can react to user input.
If an SVG image is embedded in a webpage, such an image can be modified with JavaScript as needed.
For example change the text, color or change position of elements in the image.&lt;/p&gt;

&lt;p&gt;In SVG elements can be positioned with by setting their a) x/y-coordinates and b) using transform.
Whereas the first just sets the coordinates relative to the &lt;em&gt;current&lt;/em&gt; coordinate system of the object, transform modifies the coordinate system for all this object and all childs.&lt;/p&gt;

&lt;p&gt;Positioning via coordinates only:&lt;/p&gt;

&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; width=&quot;400&quot; height=&quot;80&quot;&gt;
  &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;60&quot; height=&quot;60&quot; fill=&quot;gray&quot; /&gt;
  &lt;rect x=&quot;120&quot; y=&quot;0&quot; width=&quot;60&quot; height=&quot;60&quot; fill=&quot;green&quot; /&gt;
&lt;/svg&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-xml&quot; data-lang=&quot;xml&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;svg&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;xmlns=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;http://www.w3.org/2000/svg&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;xmlns:xlink=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;http://www.w3.org/1999/xlink&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;width=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;300&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;height=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;80&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;rect&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;x=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;160&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;y=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;10&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;width=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;60&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;height=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;60&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;fill=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;blue&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;rect&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;x=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;230&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;y=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;10&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;width=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;60&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;height=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;60&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;fill=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;green&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/svg&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Positioning via transform=”translate(x, y)”:&lt;/p&gt;

&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; width=&quot;400&quot; height=&quot;80&quot;&gt;
  &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;60&quot; height=&quot;60&quot; fill=&quot;gray&quot; transform=&quot;translate(0, 0)&quot; /&gt;
  &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;60&quot; height=&quot;60&quot; fill=&quot;green&quot; transform=&quot;translate(120, 0)&quot; /&gt;
&lt;/svg&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-xml&quot; data-lang=&quot;xml&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;svg&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;xmlns=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;http://www.w3.org/2000/svg&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;xmlns:xlink=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;http://www.w3.org/1999/xlink&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;width=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;400&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;height=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;80&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;rect&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;x=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;y=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;width=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;60&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;height=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;60&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;fill=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;gray&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;transform=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;translate(0, 0)&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;rect&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;x=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;y=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;0&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;width=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;60&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;height=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;60&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;fill=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;green&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;transform=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;translate(120, 0)&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/svg&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Both images are rendered exactly the same and from a viewer’s perspective are therefore equal.
However, those are not equal from a &lt;em&gt;programmatic&lt;/em&gt; perspective they are not.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;TL;DR: When you need to re-position SVG-elements, try to avoid transform.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here is an example with three rectangles.
id=”rect1” and id=”rect3” are positioned via coordinates whereas id=”rect2” and id=”rect2-inner” are positioned via transform(s).&lt;/p&gt;

&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; width=&quot;400&quot; height=&quot;80&quot;&gt;
  &lt;rect id=&quot;rect1&quot; x=&quot;0&quot; y=&quot;0&quot; width=&quot;60&quot; height=&quot;60&quot; fill=&quot;gray&quot; /&gt;
  &lt;g transform=&quot;translate(120, 0)&quot;&gt;
    &lt;rect id=&quot;rect2&quot; x=&quot;0&quot; y=&quot;0&quot; width=&quot;60&quot; height=&quot;60&quot; fill=&quot;green&quot; fill-opacity=&quot;0.4&quot; /&gt;
    &amp;lt;rect id=&quot;rect2-inner&quot; x=&quot;15&quot; y=&quot;15&quot; width=&quot;30&quot; height=&quot;30&quot; fill=&quot;black&quot;&quot;/&amp;gt;
  &lt;/g&gt;
  &lt;g&gt;
    &lt;rect id=&quot;rect3&quot; x=&quot;240&quot; y=&quot;0&quot; width=&quot;60&quot; height=&quot;60&quot; fill=&quot;blue&quot; fill-opacity=&quot;0.4&quot; /&gt;
    &lt;rect id=&quot;rect3-inner&quot; x=&quot;255&quot; y=&quot;15&quot; width=&quot;30&quot; height=&quot;30&quot; fill=&quot;yellow&quot; /&gt;
  &lt;/g&gt;
&lt;/svg&gt;

&lt;p&gt;Two functions are required without transform &lt;em&gt;svg-object.getBBox()&lt;/em&gt; and with transform &lt;em&gt;svg-object.getTransformToElement(svg-object)&lt;/em&gt;.
The first, returns the minimal rectangle that contains the current object including x/y-coordinates.
The second, calculates the shift between the &lt;em&gt;virtual&lt;/em&gt; coordinate systems due to transform.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rect1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;rect1&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rect2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;rect2&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rect2inner&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;rect2-inner&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rect3&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;rect3&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rect3inner&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;rect3-inner&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;rect3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getTransformToElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rect1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//x-shift = 0 (no transform)&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;rect2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getTransformToElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rect1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//x-shift = 120 (transform)&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;rect2inner&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getTransformToElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rect1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//x-shift = 120 (transform)&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;//Get x-coordinates _relative_ each coordinate system.&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;rect1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getBBox&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//0&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;rect2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getBBox&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//0 (moved by transform)&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;rect2inner&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getBBox&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//15 (moved by transform AND x)&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;rect3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getBBox&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//240&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;//Move rect3inner to center of rect1: x-only (no transform)&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;rect3inner&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;setAttributeNS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;translate(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rect1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getBBox&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rect3inner&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getBBox&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rect3inner&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getBBox&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;,0)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//Move rect2inner to center of rect3: x-only (transform)&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;transform&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rect2inner&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getTransformToElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rect3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;rect2inner&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;setAttributeNS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;translate(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;abs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;rect3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getBBox&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rect2inner&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getBBox&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;rect2inner&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;getBBox&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;,0)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;In the end both approaches work, but applying transform in addition makes moving more complicated.
And as their are nicer things to do than &lt;em&gt;debugging&lt;/em&gt; SVGs - try to avoid transform or at least RTFM.&lt;/p&gt;

&lt;p&gt;NOTE: For some SVGs (created with (Inkscape)[https://inkscape.org]), I had some trouble due to transform (getTransformToElement() always returned the same values although different transform were applied).
Inkscape removes transform attributes, when grouping and then ungroup elements; x/y-coordinates are re-calculated appropriately.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Tag 6 - oder das Ende</title>
   <link href="/urlaub/transalp/2015/07/15/tag-6-oder-das-ende.html"/>
   <updated>2015-07-15T11:33:00+02:00</updated>
   <id>/urlaub/transalp/2015/07/15/tag-6-oder-das-ende</id>
   <content type="html">&lt;p&gt;Laut Karte sollte der Tag eigentlich nicht so schlimm werden - ging erst nur bergab und dann nochmal fies bergauf.
Zwischendurch musste ich allerdings feststellen, dass das Winterjöchli zwar bergab geht, aber keine fahrbahre Strecke ist.
Also 1 Stunde das Rad an den Kühen vorbei getragen.
Als das vorbei war ging es runter ins Tal und wieder rauf. Diesen kleinen Berg hatte ich leider übersehen…&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag6/wpid-wp-1436952093619.jpg&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Knapp 2 Stunden später begann ich den Aufstieg zur Heilbronner Hütte.
Schön ist anders - mir ist nicht ganz klar, wie man diese Strecke runter fahren soll.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag6/wpid-wp-1436952166197.jpg&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Und irgendwann hatte ich beschlossen bis nach Oberstdorf weiter zu fahren - es gibt nur eine Bahn nach Berlin und die geht um 9:40…
Bei der Hütte angekommen habe ich dann kurz Bescheid gesagt, dass ich nicht da bleibe sondern gleich nach Oberstdorf weitermache.
Es war ja erst 17:30 und Sonnenuntergang erst um 21:14.
Was kann da schon schief gehen. Also wieder runter ins Tal und rauf auf den Schroffenpass (Tragen) und wieder runter (Schieben).&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag6/wpid-wp-1436952184055.jpg&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag6/wpid-wp-1436952195605.jpg&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;An der ersten Hütte nach dem Pass bekam ich einen Liter frischer Milch - frisch aus der Kuh - und dann ging es mit 30+kmh runter nach Oberstdorf.&lt;/p&gt;

&lt;p&gt;Das Ende.&lt;/p&gt;

&lt;p&gt;Nachtrag:&lt;/p&gt;

&lt;p&gt;Eine Übernachtung habe ich spontan gefunden (schickes Hotel und sehr netter Besitzer).
Das Bahnpersonal am kommenden Tag war auch sehr freundlich (Fahrradkarte können wir nicht mehr buchen, aber sprich mal mit dem Zugpersonal).
Und dann ging es nach Hause!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag6/wpid-wp-1436952388175.jpg&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Tag 5 - oder Radwandern</title>
   <link href="/urlaub/transalp/2015/07/14/tag-5-oder-radwandern.html"/>
   <updated>2015-07-14T22:19:14+02:00</updated>
   <id>/urlaub/transalp/2015/07/14/tag-5-oder-radwandern</id>
   <content type="html">&lt;p&gt;Die Tour startete mit einer  ziemlichen Hochpass.
Cooles Gelände, guter Ausblick und  es ging nur bergab.
Bis ins Tal war ich mit einem Heilbronner unterwegs gewesen.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag5/wpid-wp-1436814738071.jpg&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Und dann begann das Schieben.
Ich habe heute das Rad so knapp 4 Stunden geschoben - erst die Straße hoch, dann einen fiesen Gebirgspass hoch und dann zum Schluss zur Hütte.
Zwischendurch war das Rad ein echt guter Wanderstock…&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag5/wpid-wp-1436815037124.jpg&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Am Nachmittag ging es dann durch malerische Landschaft abwärts.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag5/wpid-wp-1436814973252.jpg&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Und es gab den ersten Defekt.
Zwischendurch hatte sich mein Schnellspanner am Hinterrad gelöst.
Autsch. Ist aber nichts passiert - hatte mich schon gewundert, warum die Bremse sich so komisch anfühlte.&lt;/p&gt;

&lt;p&gt;Zum Schluß ging es dann wieder bergauf…
Hat aber alles gut geklappt.
Zwischendurch gab es noch Mittag in Form von Frischeiwaffeln und Schokomilch - vorzüglich.&lt;/p&gt;

&lt;p&gt;Also der harte Teil der Tour ist geschafft. War aber ein echt guter Tag!&lt;/p&gt;

&lt;p&gt;Aktueller Standort: Heilbronner Hütte&lt;/p&gt;

&lt;p&gt;Over and out.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Tag 4 - oder Motivation?</title>
   <link href="/urlaub/transalp/2015/07/13/tag-4-oder-motivation.html"/>
   <updated>2015-07-13T11:54:00+02:00</updated>
   <id>/urlaub/transalp/2015/07/13/tag-4-oder-motivation</id>
   <content type="html">&lt;p&gt;Die Tour heute habe ich auch ein wenig vereinfacht - bevor mich gleich ins Gelände zu begeben, bin ich einfach die Straße bergab gerollt und nur den Anstieg zur Hütte gemacht.
Bergauf war meine Motivation echt am Ende - ich kam nicht vom Fleck und war nur am schwitzen. Dann habe ich noch einen Mitstreiter gefunden und wir sind zusammen bis zur Hütte rauf. Zwischendurch noch Cola auf einer Alm und dann Mittag - war dann echt ein guter Tag! Mein Mitstreiter ist dann am Nachmittag noch weiter auf seiner Rundtour zurück ins Tal.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag4/img_20150712_135759.jpg&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Ich bin dann noch zu Fuss ein wenig den Berg hoch und habe mir ein paar Murmeltiere angeschaut.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag4/img_20150712_161106.jpg&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag4/img_20150712_162411.jpg&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Und das war der Ausblick.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag4/img_20150712_1611331.jpg&quot; alt=&quot;image&quot; /&gt;]&lt;/p&gt;

&lt;p&gt;Aktueller Standort: Sesvenah Hütte&lt;/p&gt;

&lt;p&gt;Over and out.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Tag 3 - oder nicht einen Meter hoch</title>
   <link href="/urlaub/transalp/2015/07/11/tag-3-oder-nicht-einen-meter-hoch.html"/>
   <updated>2015-07-11T22:53:10+02:00</updated>
   <id>/urlaub/transalp/2015/07/11/tag-3-oder-nicht-einen-meter-hoch</id>
   <content type="html">&lt;p&gt;Nach der Abkürzung gestern habe ich gleich so weitergemacht.
Hoch auf das Stilfser Joch mit dem Rad war einfach nicht drin - also auf zum Busbahnhof und feststellen, dass es leider keinen Bus gibt.
Ich habe allerdings echt viel Glück gehabt!
Ein italienische Gruppen von Mountainbikefahrern hatte einen Bus gechartert, um einen Junggesellenabschied zu begehen - also rein in den Bus und es ging los.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag3/img_20150711_091728.jpg&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Die Fahrt dauerte knapp eine Stunden und dann waren wir oben. Leider wurde eines der Fahrräder beschädigt - einige Bikes hingen hinten am Bus und bei einem hat der heiße Auspuff den hinteren Mantel angeschmolzen.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag3/img_20150711_100520.jpg&quot; alt=&quot;image&quot; /&gt;]&lt;/p&gt;

&lt;p&gt;Oben angekommen, begann eine echt langweilige Abfahrt mit glühenden Bremsschreiben.
Einfach nur runter den Asphalt und alle paar Meter Pause machen, damit die Bremsen abkühlen.
Einen kurzen Trail habe ich dann zum Glück noch gefunden.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag3/img_20150711_112536.jpg&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Dann war ich schon im Tal und im Hotel - es war kurz vor 12.
Also noch eine Stunden wandern und dann den Nachmittag einfach nur rumliegen - nur mal den Ausblick genießen.&lt;/p&gt;

&lt;p&gt;Aktueller Standort: Trafoi&lt;/p&gt;

&lt;p&gt;Over and out.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Tag 2 - oder das gute Gefühl im Bus zu sitzen</title>
   <link href="/urlaub/transalp/2015/07/10/tag-2-oder-das-gute-gefuhl-im-bus-zu-sitzen.html"/>
   <updated>2015-07-10T20:15:15+02:00</updated>
   <id>/urlaub/transalp/2015/07/10/tag-2-oder-das-gute-gefuhl-im-bus-zu-sitzen</id>
   <content type="html">&lt;p&gt;Ich bin heute los und mir war schon klar, dass die geplante Route nicht machbar war.
Ich hätte mich einfach zwischendurch in die Gegend gelegt und wäre dann bis morgen liegen geblieben.
Hier die Stelle der Entscheidung - irgendwo 10km später fängt da richtig fieses Gelände an (bergauf).&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag2/wpid-wp-1436534384456.jpg&quot; alt=&quot;image&quot; /&gt;]&lt;/p&gt;

&lt;p&gt;Also in den sauren Apfel gebissen und Landstraße.
War trotzdem ein sehr zäher Prozess, aber mit guter Aussicht.&lt;/p&gt;

&lt;p&gt;Und dann eine kolossale Fehlentscheidung meinerseits - statt wie geplant den ursprünglichen Pass (wie laut Tour geplant) zunehmen, habe ich gepokert und wollte den folgenden nehmen.
Naja. Auf dem Weg dahin ging es auf der Straße richtig bergab und damit hatte ich keine reale Chance mehr.
Also rein in den Bus…&lt;/p&gt;

&lt;p&gt;Aber sind hier alle sehr hilfsbereit und Kommunikation mit Händen, Füßen und Landkarten kein Problem.&lt;/p&gt;

&lt;p&gt;PS: Fotos der Straße habe ich keine gemacht.&lt;/p&gt;

&lt;p&gt;Aktueller Standort: Bormio&lt;/p&gt;

&lt;p&gt;Over and out.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Tag 1 - oder Hügel werden zu Bergen</title>
   <link href="/urlaub/transalp/2015/07/09/tag-1-oder-hugel-werden-zu-bergen.html"/>
   <updated>2015-07-09T20:22:21+02:00</updated>
   <id>/urlaub/transalp/2015/07/09/tag-1-oder-hugel-werden-zu-bergen</id>
   <content type="html">&lt;p&gt;Heute ging es richtig los. Am Anfang war es nur Bundesstraßen (eher umspannenden).
Trotzdem Klasse, weil es ging nur bergauf.
Also Musik ins Ohr und los geht es.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag1/wpid-wp-1436465218495.jpg&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Dann tauchte links plötzlich ein ziemlich blauer See auf und ich war bei dem strahlenden Sonnenschein fast baden - hätte nur zu lange gedauert.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag1/wpid-wp-1436465223819.jpg&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Und so sieht eine ziemlich spektakuläre Straße aus (links ging es ziemlich runter).&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag1/wpid-wp-1436465233171.jpg&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Zwischendurch musste ich mich durch eine Rudel Bergziegen(?) schleichen und später gab es dann auch freilaufende Kühe - wie in der Werbung.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag1/wpid-wp-1436465246731.jpg&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Ansonsten war der Tag echt lang.
Irgendwann war selbst der kleinste Hügel enorm und an vielen Stellen hab ich dann einfach geschoben.
Ich muss unbedingt meine Kräfte besser einteilen.
Auf jeden Fall einen Hammer Ausblick und wenn es bergab geht, ist die Welt ziemlich in Ordnung.&lt;/p&gt;

&lt;p&gt;Aktueller Standort: Dimaro.&lt;/p&gt;

&lt;p&gt;Over and out.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Tag 0 - Anfang vom Ende</title>
   <link href="/urlaub/transalp/2015/07/08/anfang-vom-ende-2.html"/>
   <updated>2015-07-08T21:29:19+02:00</updated>
   <id>/urlaub/transalp/2015/07/08/anfang-vom-ende-2</id>
   <content type="html">&lt;p&gt;Geht los. 
Heute schon einmal einen Bahn-Marathon erledigt - 14 Stunden sitzen, warten und umsteigen sind richtig lang.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag0/wpid-wp-14363866851364.jpg&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Hat aber alles einwandfrei funktioniert.
Und zwischendurch traf ich noch zur Abwechslung den Orient-Express (im Bahnhof Innsbruck).
Der Zug ist schon ein eindrucksvolles Gefährt!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag0/wpid-wp-14363866930134.jpg&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Und am Ende bin ich gut angekommen.
Allerdings ist der erste Eindruck Gardasee - Wolkenbruch.
Oder falls das geht: Wolkenbrüche.
Stand auch nicht im Wetterbericht.
Bin also auf Präzision die kommenden Tage gespannt.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/tag0/wpid-wp-1436389900943.jpg&quot; alt=&quot;image&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Ansonsten sind die Berge schon eindrucksvoll und die Ortschaft Arco echt cool.
Ist so ein kleines italienisches Örtchen mit viel Flair.
Und gutes Essen und nette Gastgeber gibt es hier auch.&lt;/p&gt;

&lt;p&gt;Over and out&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Subjective Quality of Webpage Loading: The Impact of Delayed and Missing Elements on Quality Ratings and Task Completion Time</title>
   <link href="/publications/2015/qomex-web-failure.html"/>
   <updated>2015-05-26T00:00:00+02:00</updated>
   <id>/publications/2015/qomex-web-qoe-failure</id>
   <content type="html">
</content>
 </entry>
 
 <entry>
   <title>Simulating adaptive video coding</title>
   <link href="/2015/03/video-bandwidth.html"/>
   <updated>2015-03-21T12:00:00+01:00</updated>
   <id>/2015/03/video-coding-adaptive-bandwidth</id>
   <content type="html">&lt;p&gt;For a subjective user study on temporal effects of varying system performance, I needed to create a video with varying video encoding bandwidth, e.g. up to min 3 take 2 Mbit/s and then for 1 min 0.5 Mbit/s.&lt;/p&gt;

&lt;p&gt;This can be easily achieved using &lt;a href=&quot;https://www.ffmpeg.org/&quot;&gt;ffmpeg&lt;/a&gt;/avconv:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;//1. &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;optional&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; Determine keyframe position using _ffprobe_ &lt;span class=&quot;o&quot;&gt;([&lt;/span&gt;see]&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;http://superuser.com/questions/554620/how-to-get-time-stamp-of-closest-keyframe-before-a-given-timestamp-with-ffmpeg&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
ffprobe &lt;span class=&quot;nt&quot;&gt;-select_streams&lt;/span&gt; v &lt;span class=&quot;nt&quot;&gt;-show_frames&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-v&lt;/span&gt; quiet VIDEO | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-F&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos; 
  /pict_type=/ { if (index($2, &quot;I&quot;)) { i=1; } else { i=0; } } 
  /pkt_pts_time/ { if (i &amp;amp;&amp;amp; ($2 &amp;gt;= 150)) print $2; } &apos;&lt;/span&gt; | &lt;span class=&quot;nb&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-n&lt;/span&gt; 1

//2. Encode all parts of the video
ffmpeg &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; VIDEO &lt;span class=&quot;nt&quot;&gt;-ss&lt;/span&gt;  0  &lt;span class=&quot;nt&quot;&gt;-to&lt;/span&gt; 180 &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt;:v 2M  PART1
ffmpeg &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; VIDEO &lt;span class=&quot;nt&quot;&gt;-ss&lt;/span&gt; 180 &lt;span class=&quot;nt&quot;&gt;-to&lt;/span&gt; 240 &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt;:v 1M PART2
ffmpeg &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; VIDEO ...

//3. Paste all parts together &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;replace xx accordingly&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
ffmpeg &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; PART1 &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; PART2 ... &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; PARTxx &lt;span class=&quot;nt&quot;&gt;-filter_complex&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;[0:0] [1:0] ... [xx:0] concat=n=xx:v=1 [v]&apos;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-map&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;[v]&apos;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-b&lt;/span&gt;:v 20M VIDEO_RECODED

//At this point the video encoding bandwidth should be rather big &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;here 20Mbit/s&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;, so the introduced articifacts are encoded properly.

//4. Verify that video is frame identical
//If the &lt;span class=&quot;nb&quot;&gt;cut &lt;/span&gt;timestamps are not correct, single frames might be dropped and thus audio and video get asynchronuous.
//For this &lt;span class=&quot;nb&quot;&gt;cut &lt;/span&gt;one frame &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;best almost at the end with same motion&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; and save it &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;the original and the transcoded video.
//When comparing those they should look identical &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;especially viewing angle&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; except &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;additional coding artificats.
ffmpeg &lt;span class=&quot;nt&quot;&gt;-ss&lt;/span&gt; 00:34:00 &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; 1 &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; VIDEO &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; mjpeg VIDEO.jpg
ffmpeg &lt;span class=&quot;nt&quot;&gt;-ss&lt;/span&gt; 00:34:00 &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; 1 &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; VIDEO_RECODED &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; mjpeg VIDEO_RECODED.jpg

//5. &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;optional&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; Re-add the audio from original VIDEO
ffmpeg &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; VIDEO_RECODED &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; VIDEO &lt;span class=&quot;nt&quot;&gt;-map&lt;/span&gt; 0:0 &lt;span class=&quot;nt&quot;&gt;-map&lt;/span&gt; 1:1 &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt;:a copy &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt;:v copy &lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

</content>
 </entry>
 
 <entry>
   <title>FreeBSD 10: Downgrading a packet with &lt;i&gt;pkg&lt;/i&gt;</title>
   <link href="/2015/03/freebsd-pkg-downgrade.html"/>
   <updated>2015-03-21T12:00:00+01:00</updated>
   <id>/2015/03/freebsd-pkg-downgrade</id>
   <content type="html">&lt;p&gt;I needed to downgrade a package (&lt;a href=&quot;http://www.asterisk.org&quot;&gt;Asterisk&lt;/a&gt;) on a FreeBSD 10.1.
After an update I found that my configuration had some issues.&lt;/p&gt;

&lt;p&gt;Actually, &lt;em&gt;pkg&lt;/em&gt; makes downgrading a package (incl. it’s dependencies) a very convenient task.
Just get the YOURFAV.VERSION.xz for your desired version (take a look into /var/pkg/cache).&lt;/p&gt;

&lt;p&gt;And then run:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;pkg &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;YOURFAV.VERSION.xz&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;After downgrading everything and searching for ours I found the mistake: spelling errors in a configuration file.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Methods for assessing the Quality of Transmitted Speech and of Speech Communication Services</title>
   <link href="/publications/2015/australian-acoustics.html"/>
   <updated>2014-12-01T00:00:00+01:00</updated>
   <id>/publications/2015/australianaccoustics</id>
   <content type="html">
</content>
 </entry>
 
 <entry>
   <title>Degrading calls: connecting Asterisk through JACK with Puredata</title>
   <link href="/2014/11/asterisk-jack-puredata.html"/>
   <updated>2014-11-01T12:00:00+01:00</updated>
   <id>/2014/11/asterisk-jack-puredata</id>
   <content type="html">&lt;p&gt;Sometimes it is necessary to get access to the audio of a VoIP telephony connection (more precisely SIP/RTP).
My reason for this is quite simple: for laboratory studies on subjective quality of telephony, I need be able to introduce degradations like noise and speaker echo.&lt;/p&gt;

&lt;p&gt;This is a short howto (for Ubuntu 14.04) to let &lt;a href=&quot;http://www.asterisk.org/&quot;&gt;Asterisk&lt;/a&gt; run in proxy mode (directmedia=no), route the audio via &lt;a href=&quot;http://jackaudio.org/&quot;&gt;JACK&lt;/a&gt; to &lt;a href=&quot;http://puredata.info/&quot;&gt;Puredata&lt;/a&gt; and back.
In Puredata then audio can be modified as needed.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;h2 id=&quot;install-software&quot;&gt;Install software:&lt;/h2&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;asterisk qjackctl puredata&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;h2 id=&quot;setup-realtime-for-group-audio-optional&quot;&gt;Setup realtime for group &lt;em&gt;audio&lt;/em&gt; (optional)&lt;/h2&gt;
    &lt;p&gt;If you need realtime for JACK, then &lt;a href=&quot;http://jackaudio.org/faq/linux_rt_config.html&quot;&gt;enable&lt;/a&gt; it.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;h2 id=&quot;configure-asterisk&quot;&gt;Configure Asterisk&lt;/h2&gt;
    &lt;p&gt;Configure one extension (phone number) that:&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;answers the call&lt;/li&gt;
  &lt;li&gt;enables JACK for the &lt;em&gt;caller to callee channel&lt;/em&gt;,&lt;/li&gt;
  &lt;li&gt;then dials the callee,&lt;/li&gt;
  &lt;li&gt;and on answering enables JACK for the &lt;em&gt;callee to caller channel&lt;/em&gt; using a post dial macro.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The &lt;em&gt;i(…)&lt;/em&gt; and &lt;em&gt;o(…)&lt;/em&gt; tell asterisk to connect directly to the defined JACK ports - thus PD should already be running.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;extensions = {
    default = {

	[&quot;_XX&quot;] = function(c, e)
	    app.answer()
	    channel.JACK_HOOK(&quot;manipulate,i(pure_data_0:input0),o(pure_data_0:output0)&quot;):set(&quot;on&quot;)
	    app.dial(&quot;SIP/&quot; .. e, nil, &quot;M(jack)&quot;)
	end;
    };
    [&quot;macro-jack&quot;] = {
	[&quot;s&quot;] = function(c, e)
	    channel.JACK_HOOK(&quot;manipulate,i(pure_data_0:input1),o(pure_data_0:output1)&quot;):set(&quot;on&quot;)
	end;
    };
}&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Reload the configuration:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;asterisk &lt;span class=&quot;nt&quot;&gt;-rx&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;core reload&quot;&lt;/span&gt;
asterisk &lt;span class=&quot;nt&quot;&gt;-rx&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;module reload pbx_lua.so&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;&lt;strong&gt;ATTENTION:&lt;/strong&gt; If JACK is not running and the &lt;em&gt;asterisk JACK application&lt;/em&gt; is thus failing to connect, it fail silently by just emitting a warning and audio is passed on directly.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;h2 id=&quot;start-jack-and-puredata&quot;&gt;Start JACK and Puredata&lt;/h2&gt;
    &lt;p&gt;All applications connecting to a JACK server running as user &lt;em&gt;X&lt;/em&gt; need also to run as &lt;em&gt;X&lt;/em&gt;.
As Asterisk is running as user &lt;em&gt;asterisk&lt;/em&gt; simply start JACK and Puredata as user &lt;em&gt;asterisk&lt;/em&gt;.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;###JACK
Start JACK either directly or using &lt;em&gt;qjackctl&lt;/em&gt; as user &lt;em&gt;asterisk&lt;/em&gt;.
If you need realtime, &lt;a href=&quot;http://jackaudio.org/faq/linux_rt_config.html&quot;&gt;enable it properly&lt;/a&gt;.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;nb&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; asterisk &lt;span class=&quot;s2&quot;&gt;&quot;jackd --no-realtime -d dummy&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;&lt;em&gt;Dummy&lt;/em&gt; is used as backend as I do not need local sound output from JACK - if you want it use Alsa instead.&lt;/p&gt;

&lt;p&gt;###Puredata
Start Puredata as user &lt;em&gt;asterisk&lt;/em&gt; and connect to JACK.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;nb&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; asterisk bash pd &lt;span class=&quot;nt&quot;&gt;-jack&lt;/span&gt; YourPatchFileHereOrNot&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Then just enable DSP or do &lt;a href=&quot;http://puredata.info/docs/faq?full=1&quot;&gt;automatically&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Puredata version before 0.46&lt;/em&gt;
Overwriting the HOME-variable is necessary for Puredata version less than &lt;a href=&quot;https://bugs.launchpad.net/ubuntu/+source/puredata/+bug/1359410&quot;&gt;version 0.46&lt;/a&gt;, which will be included in &lt;a href=&quot;https://launchpad.net/ubuntu/+source/puredata&quot;&gt;Ubuntu 15.04&lt;/a&gt;.
Otherwise the UI is not loaded as reading the config-files fails and the UI process stops.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-sh&quot; data-lang=&quot;sh&quot;&gt;&lt;span class=&quot;nb&quot;&gt;sudo&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; asterisk bash
&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;HOME&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/tmp
&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; pd &lt;span class=&quot;nt&quot;&gt;-jack&lt;/span&gt; YourPatchFileHereOrNot&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Have fun.&lt;/p&gt;

&lt;h2 id=&quot;known-issues&quot;&gt;Known issues:&lt;/h2&gt;
&lt;ol&gt;
  &lt;li&gt;Asterisk Version prior 13 are limited to 8000Hz for interaction with JACK - see &lt;a href=&quot;/2014/10/asterisk-jack-wideband.html&quot;&gt;here&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;If JACK is not running Asterisk just ignores it and the call continues without.&lt;/li&gt;
  &lt;li&gt;Due to the large numbers of buffers involved a relatively high delay is to be expected - a guess is ~80-100ms.&lt;/li&gt;
&lt;/ol&gt;
</content>
 </entry>
 
 <entry>
   <title>Asterisk: Enabling JACK connectivity to be (super-)wideband</title>
   <link href="/2014/10/asterisk-jack-wideband.html"/>
   <updated>2014-10-29T08:45:00+01:00</updated>
   <id>/2014/10/asterisk-jack-wideband</id>
   <content type="html">&lt;p&gt;During the summer I found that the &lt;a href=&quot;https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+Application_JACK&quot;&gt;JACK application&lt;/a&gt; of &lt;a href=&quot;http://www.asterisk.org&quot;&gt;Asterisk&lt;/a&gt; (prior version 12; I used 11) only supported narrowband (8000Hhz).
In general is the &lt;em&gt;JACK application&lt;/em&gt; nothing else than two buffers incl. two resamplers (to and from JACK).&lt;/p&gt;

&lt;p&gt;For the wideband case Asterisk was downsampling to 8000Hz handing the data to the &lt;em&gt;JACK application&lt;/em&gt;, which resampled and handed over to JACK and vice versa.&lt;/p&gt;

&lt;p&gt;I found that three things needed to be changed:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Prevent Asterisk from downsampling to 8000Hz&lt;/li&gt;
  &lt;li&gt;Dynamic buffer sizes depending on Asterisk and JACK sampling frequency&lt;/li&gt;
  &lt;li&gt;Resampling parameters&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After that the necessary changes were straight forward and the &lt;a href=&quot;https://reviewboard.asterisk.org/r/3618/&quot;&gt;patch&lt;/a&gt; made it into &lt;em&gt;&lt;a href=&quot;http://svnview.digium.com/svn/asterisk/branches/13/CHANGES&quot;&gt;Asterisk 13&lt;/a&gt;&lt;/em&gt;.
The functionality can be easily backported to &lt;em&gt;Asterisk 11&lt;/em&gt; by just replacing &lt;em&gt;apps/app_jack.c&lt;/em&gt; using the one of &lt;em&gt;Asterisk 13&lt;/em&gt;.
Just follow this &lt;a href=&quot;/2014/01/patch-asterisk-module-without-breaking.html&quot;&gt;procedure&lt;/a&gt; (on Debian/Ubuntu).&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Web-QoE under real-world distractions: Two test cases</title>
   <link href="/publications/2014/qomex-web-qoe.html"/>
   <updated>2014-09-18T00:00:00+02:00</updated>
   <id>/publications/2014/qomex-web-qoe-distraction</id>
   <content type="html">
</content>
 </entry>
 
 <entry>
   <title>Modelling Multi-episodic Quality Perception for Different telecommunication Services: First Insights</title>
   <link href="/publications/2014/qomex-multi-episodic.html"/>
   <updated>2014-09-18T00:00:00+02:00</updated>
   <id>/publications/2014/qomex-multi-episodic</id>
   <content type="html">
</content>
 </entry>
 
 <entry>
   <title>ITU-T P.851: Continuous assessment scale as Inkscape/SVG</title>
   <link href="/2014/08/continuous-quality-scale.html"/>
   <updated>2014-08-06T12:00:00+02:00</updated>
   <id>/2014/08/continuous-quality-scale</id>
   <content type="html">&lt;p&gt;The &lt;em&gt;continuous quality assessment scale&lt;/em&gt; defined in &lt;a href=&quot;https://www.itu.int/rec/T-REC-P.851-200311-I/en&quot;&gt;ITU-T P.851, p.19&lt;/a&gt;).
&lt;img alt=&quot;Continous quality assessment scale as plain SVG&quot; src=&quot; /images//2014/08/continuous-quality-scale.html/quality7pt_scale_plain.svg&quot; style=&quot;width:90%;margin:auto&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/images//2014/08/continuous-quality-scale.html/quality7pt_scale.svg&quot; style=&quot;width:90%;margin:auto&quot;&gt;Inkscape version for download&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;License: CC-BY-SA&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>My Cube Reaction SC Pro Race Line (20&quot;) was stolen on 23th July 2014</title>
   <link href="/2014/07/cube-reaction-sc.html"/>
   <updated>2014-07-27T12:00:00+02:00</updated>
   <id>/2014/07/cube-reaction-sc</id>
   <content type="html">&lt;p&gt;On 23th July 2014 my Cube bike was stolen in Berlin.
The serial number of the frame is &lt;em&gt;A6G99079&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img style=&quot;width:18em; margin:auto;&quot; src=&quot;/images//2014/07/cube-reaction-sc.html/2.jpg&quot; /&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Asterisk using LUA: How to pre-dial and macro (incl. parameters)</title>
   <link href="/2014/06/asterisk-lua-predial-macro.html"/>
   <updated>2014-06-09T22:45:00+02:00</updated>
   <id>/2014/06/asterisk-lua-dialplan-predial-macro</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;http://www.asterisk.org&quot;&gt;Asterisk&lt;/a&gt; allows to implement a dialplan in &lt;a href=&quot;http://www.lua.org/&quot;&gt;Lua&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It works quite well, if you are aware that the parser is very nitpicking againt indentation: always use either spaces or tabs.
The &lt;a href=&quot;https://wiki.asterisk.org/wiki/display/AST/Dialplan+to+Lua+Reference&quot;&gt;Asterisk documentation&lt;/a&gt; gives a a nice overview how to use Lua.&lt;/p&gt;

&lt;p&gt;Macros and Pre-Dial-Handler are missing there, but they are quite useful…
Here is the syntax example:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-lua&quot; data-lang=&quot;lua&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;n&quot;&gt;extensions&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;macro-mhandler&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
		&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;s&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
			&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;verbose&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Hello Macro!&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
			&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;verbose&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Got parameter: &quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;..&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;channel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ARG1&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
		&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

	&lt;span class=&quot;n&quot;&gt;predial&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
		&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;phandler&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
			&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;verbose&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Hello Pre-dial!&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
		&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

	&lt;span class=&quot;n&quot;&gt;default&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
		&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;_X&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
			&lt;span class=&quot;n&quot;&gt;app&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dial&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;SIP/&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;..&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;nil&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;B(predial,phandler,1)M(mhandler^Put your parameter here)&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
		&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

</content>
 </entry>
 
 <entry>
   <title>PPA for Ubuntu: SIP-Tools.</title>
   <link href="/2014/06/ubuntu-ppa-sip-tools.html"/>
   <updated>2014-06-05T08:45:00+02:00</updated>
   <id>/2014/06/ppa-sip-tools</id>
   <content type="html">&lt;p&gt;The SIP-Tools PPA &lt;a href=&quot;https://launchpad.net/~dennis.guse/+archive/sip-tools&quot;&gt;https://launchpad.net/~dennis.guse/+archive/sip-tools&lt;/a&gt; now contains:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.pjsip.org/&quot;&gt;PJSIP&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.itu.int/rec/T-REC-G.191/_page.print&quot;&gt;ITU-T STL 2009&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.itu.int/rec/T-REC-P.862&quot;&gt;ITU-T PESQ&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have some problems with PJSIP, please report them to the &lt;a href=&quot;http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org&quot;&gt;mailing list&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Maintenance of the PPA will be done only for the current Ubuntu release (as of this writing: Trusty).&lt;/p&gt;

&lt;p&gt;To install a package from the PPA do the following:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;add-apt-repository ppa:dennis.guse/sip-tools
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get update
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Whatever you need&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

</content>
 </entry>
 
 <entry>
   <title>PJSIP 2.21 for Ubuntu Trusty via PPA</title>
   <link href="/2014/06/pjsip-for-trusty.html"/>
   <updated>2014-06-05T07:45:00+02:00</updated>
   <id>/2014/06/pjsip-2.2-ubuntu-trusty</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;http://www.pjsip.org/&quot;&gt;PJSIP 2.21&lt;/a&gt; (svn4852) is now available via PPA:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://launchpad.net/~dennis.guse/+archive/sip-tools&quot;&gt;https://launchpad.net/~dennis.guse/+archive/sip-tools&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Features:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Python 2.7 bindings (pjsua and pjsua2)&lt;/li&gt;
  &lt;li&gt;OpenSSL&lt;/li&gt;
  &lt;li&gt;Video support (also python-pjsua: thanks to Frank Haase)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On Ubuntu do the following:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;add-apt-repository ppa:dennis.guse/sip-tools
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get update
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;libpjsip-samples python-pjsua python-pjsua2&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

</content>
 </entry>
 
 <entry>
   <title>HTML: which letter was clicked in text?</title>
   <link href="/2014/06/html-which-letter-was-clicked.html"/>
   <updated>2014-06-03T12:00:00+02:00</updated>
   <id>/2014/06/html-which-letter-was-clicked</id>
   <content type="html">&lt;p&gt;For my spare-time project &lt;a href=&quot;https://github.com/dennisguse/TheSchreibmaschine/&quot;&gt;TheSchreibmaschine&lt;/a&gt;
I need to get the position of the letter in a &lt;em&gt;div&lt;/em&gt; that was clicked.&lt;/p&gt;

&lt;p&gt;Limitation: it is not possible to add additional childs to the div.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;div&amp;gt;&lt;/span&gt;This is some awesome text&lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The solution is actually quite straight forward:
just capture the &lt;em&gt;mouse event&lt;/em&gt; and ask the document to calculate the &lt;em&gt;caret&lt;/em&gt;-position using the mouse coordinates.&lt;/p&gt;

&lt;p&gt;Here is the solution I adopted:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;insertBreakAtPoint&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;textNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;offset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;if &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;caretPositionFromPoint&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;    &lt;span class=&quot;c1&quot;&gt;// standard&lt;/span&gt;
	&lt;span class=&quot;nx&quot;&gt;range&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;caretPositionFromPoint&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pageX&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pageY&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
	&lt;span class=&quot;nx&quot;&gt;textNode&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;offsetNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;nx&quot;&gt;offset&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;offset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;caretRangeFromPoint&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;    &lt;span class=&quot;c1&quot;&gt;// WebKit&lt;/span&gt;
	&lt;span class=&quot;nx&quot;&gt;range&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;caretRangeFromPoint&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pageX&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;pageY&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
	&lt;span class=&quot;nx&quot;&gt;textNode&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;startContainer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;nx&quot;&gt;offset&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;range&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;startOffset&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// do whatever you wanted here!&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;There is one limitation (at least I have a small problem in Chromium) that the range.textNode must 
not necessarily identical to the one that was clicked: the contained text might be shorter than expected.&lt;/p&gt;

&lt;p&gt;The reason for that remained unknown. I just did the access via range.textNode.parentElement.firstChild 
as in my case the div only has one child, which is the text.&lt;/p&gt;

&lt;p&gt;For further reference the &lt;a href=&quot;http://stackoverflow.com/questions/23831611/html-text-in-block-element-get-exact-position-of-click&quot;&gt;stackoverflow&lt;/a&gt;.
Thanks to @TimDown.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Asterisk: SIP Presence is only partly supported</title>
   <link href="/2014/04/asterisk-sip-presence.html"/>
   <updated>2014-05-06T12:00:00+02:00</updated>
   <id>/2014/04/asterisk-sip-presence</id>
   <content type="html">&lt;p&gt;Asterisk 11 and following added support for publishing/distributing the &lt;a href=&quot;https://wiki.asterisk.org/wiki/display/AST/Presence+State&quot;&gt;presence&lt;/a&gt; of an extension.
This enhances the &lt;em&gt;hints&lt;/em&gt;, which are so faronly server-generate extension states, e.g. idle, unavailable, busy.
Actually the presence can be set for &lt;em&gt;an extension&lt;/em&gt; independant how this extension is connected to the system.&lt;/p&gt;

&lt;p&gt;So far the functionality was limited to &lt;em&gt;exten =&amp;gt; _X,hint,SIP/${EXTEN}&lt;/em&gt;, which gives you server-side generated extension states.
Now the presence state can be set for an extension using the dial plan function/variable &lt;em&gt;PRESENCE_STATE()&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;In my case, clients are only connecting via &lt;em&gt;SIP&lt;/em&gt; and can now subscribe for presence states of their buddies (in this case extensions).
Works like charm.&lt;/p&gt;

&lt;p&gt;However: The presence state cannot be updated the SIP way by a SIP client for the used extension (which is denoted by a hint).
Asterisk does not SUBSCRIBE on the presence state of the client, when it registers.&lt;/p&gt;

&lt;p&gt;Thus the client does not know that Asterisk would be interested in his presence state and therefore does not NOTIFY Asterisk, if his presence state changes.
And now Asterisk cannot inform all other clients that are subscribed on this extension…&lt;/p&gt;

&lt;p&gt;At the moment Asterisk only allows to set the presence state it presents for an extensions using the &lt;em&gt;PRESENCE_STATE()&lt;/em&gt; and sadly not the SIP way.&lt;/p&gt;

&lt;p&gt;Olle E. Johansson confirmed the behavior on the Asterisk &lt;a href=&quot;https://www.mail-archive.com/asterisk-dev@lists.digium.com/msg34496.html&quot;&gt;mailing list&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Asterisk only implements 50% of &lt;a href=&quot;http://www.ietf.org/rfc/rfc3856.txt&quot;&gt;RFC 3856&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Again: Thanks to Frank Haase for his support and wisdom!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Update &lt;a href=&quot;https://issues.asterisk.org/jira/browse/ASTERISK-23723&quot;&gt;reported to Asterisk&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>PJSIP Automatic Gain Control</title>
   <link href="/2014/04/pjsip-automatic-gain-control.html"/>
   <updated>2014-04-26T12:00:00+02:00</updated>
   <id>/2014/04/pjsip-automatic-gain-control</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;http://www.pjsip.org&quot;&gt;PJSIP&lt;/a&gt; contains an &lt;em&gt;un-documentated&lt;/em&gt; feature that does volume adjustments during &lt;a href=&quot;https://trac.pjsip.org/repos/wiki/media-flow&quot;&gt;media-flow&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;&lt;a href=&quot;https://trac.pjsip.org/repos/wiki/media-flow&quot;&gt;conference bridge&lt;/a&gt;&lt;/em&gt; contains a very basic &lt;a href=&quot;http://en.wikipedia.org/wiki/Automatic_gain_control&quot;&gt;Automatic Gain Control&lt;/a&gt; that adjusts the volume level of each to-be-mixed signals, if the volume difference to the previous frame is to large.&lt;/p&gt;

&lt;p&gt;It is however implement as define-directive in the C-code and thus enabled during compile time.&lt;/p&gt;

&lt;p&gt;Here is the &lt;a href=&quot;http://svn.pjsip.org/repos/pjproject/trunk/pjmedia/src/pjmedia/conference.c&quot;&gt;code&lt;/a&gt;:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-c&quot; data-lang=&quot;c&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;cp&quot;&gt;#define ATTACK_A    (conf-&amp;gt;clock_rate / conf-&amp;gt;samples_per_frame)
#define ATTACK_B    1
#define DECAY_A	    0
#define DECAY_B	    1
&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;#define SIMPLE_AGC(last, target) \
    if (target &amp;gt;= last) \
    target = (ATTACK_A*(last+1)+ATTACK_B*target)/(ATTACK_A+ATTACK_B); \
    else \
    target = (DECAY_A*last+DECAY_B*target)/(DECAY_A+DECAY_B)
&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;#define MAX_LEVEL   (32767)
#define MIN_LEVEL   (-32768)
&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;#define IS_OVERFLOW(s) ((s &amp;gt; MAX_LEVEL) || (s &amp;lt; MIN_LEVEL))&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The investigation for this feature started as some severe “quality changes” (during a call the sound got quantizied heavily with a lower volume) unexpectetedly occured using PJSIP under perfect conditions:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Edirol UA-25EX&lt;/li&gt;
  &lt;li&gt;Beyer Dynamics DT-290&lt;/li&gt;
  &lt;li&gt;noise-free room (laboratory)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Dummy_head_recording&quot;&gt;Dummy head&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Operation System: Ubuntu 13.10&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finding and disabling the AGC lead us to another issue that was masked by it.
Somehow the EchoCanceler kicks in after around 5s seconds of continuous speech and the resulting signal is sounds heavily reduced in volume (spectogram is similar to original signal).
And the AGC increases the volume again fast enough leading to “&lt;a href=&quot;http://en.wikipedia.org/wiki/Quantization_(signal_processing)&quot;&gt;quantisation&lt;/a&gt;“-like sound.&lt;/p&gt;

&lt;p&gt;So disabling the EchoCanceler (a runtime option) as well as (just to be sure) the AGC fixes the problem.&lt;/p&gt;

&lt;p&gt;Thanks to Frank Haase for his support and wisdom!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Temporal Development of Quality of Experience</title>
   <link href="/publications/2014/qoe-book-chapter.html"/>
   <updated>2014-03-05T00:00:00+01:00</updated>
   <id>/publications/2014/qoe-book-chapter</id>
   <content type="html">
</content>
 </entry>
 
 <entry>
   <title>Disable Asterisk call loop detection: SIP 482 check</title>
   <link href="/2014/01/disable-asterisk-call-loop-detection.html"/>
   <updated>2014-01-15T14:50:00+01:00</updated>
   <id>/2014/01/disable-asterisk-call-loop-detection</id>
   <content type="html">&lt;p&gt;&lt;em&gt;UPDATE: This patch is not required on Asterisk 11.7 upwards.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Asterisk 1.8 does not allow to loop sip calls. This is in fact the correct behavior as specified in the SIP RFC. However, in some cases this might be very well the behavior that someone wants.
What loop detection prevents is essentially that an Asterisk instance &lt;em&gt;does not accept an incoming call that was triggered by himself&lt;/em&gt;.
This might be necessary, if the Asterisk:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Tries to call himself (I had a good reason to do this)&lt;/li&gt;
  &lt;li&gt;Asterisk tries to make a SIP call to another SIP peer, but the call is routed back to the Asterisk.
This might happen if Asterisk registers with two or more accounts at an external SIP provider and one of account tries to call the other.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;How to disable loop detection&lt;/em&gt;
There is no default option provided to deactivate this feature (as this should only be done, if you know what you are doing).
Loop detection is done in&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;channel/chan_sip.c in function handle_request_invite(…)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;On line 22325 (Asterisk 1.8) a check is done, if loop detection should be done. You can also search for &lt;em&gt;482 Loop Detected&lt;/em&gt;.
If this if-statement is disabled (add &lt;em&gt;0 == 1 &amp;amp;&amp;amp;&lt;/em&gt;) or removed, no loop detection will be done.
Re-compile and install as I described &lt;a href=&quot;http://blog.g00se.org/2014/01/patch-asterisk-module-without-breaking.html&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I am using Asterisk for Transcoding twice in the same instance.&lt;/p&gt;

&lt;p&gt;Basically Asterisk fowards an incoming SIP-call to himself (setting &lt;em&gt;SIP_CODEC_OUTBOUND&lt;/em&gt; to whatever I needed) and then relays the call to the callee:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Caller Client –(slin) -&amp;gt; Asterisk –(whatever) -&amp;gt; Asterisk –(slin) -&amp;gt; Callee Client&lt;/p&gt;
&lt;/blockquote&gt;
</content>
 </entry>
 
 <entry>
   <title>Patch a asterisk module without breaking package management on Ubuntu</title>
   <link href="/2014/01/patch-asterisk-module-without-breaking.html"/>
   <updated>2014-01-15T14:28:00+01:00</updated>
   <id>/2014/01/patch-asterisk-module-without-breaking</id>
   <content type="html">&lt;p&gt;I needed to modify one module (chan_sip) of Asterisk, but was to lazy to download and install Asterisk manually.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Install build-tools
    &lt;blockquote&gt;
      &lt;p&gt;apt-get install build-essential&lt;/p&gt;
    &lt;/blockquote&gt;
  &lt;/li&gt;
  &lt;li&gt;Get the source and build dependencies
    &lt;blockquote&gt;
      &lt;p&gt;apt-get source asterisk
apt-get build-dep asterisk&lt;/p&gt;
    &lt;/blockquote&gt;
  &lt;/li&gt;
  &lt;li&gt;Patch or do whatever you wanted.&lt;/li&gt;
  &lt;li&gt;Re-compile Asterisk
    &lt;blockquote&gt;
      &lt;p&gt;dpkg-buildpackage -rfakeroot -b&lt;/p&gt;
    &lt;/blockquote&gt;
  &lt;/li&gt;
  &lt;li&gt;Install the Asterisk module
    &lt;blockquote&gt;
      &lt;p&gt;cp channels/chan_sip.so /usr/lib/asterisk/modules/&lt;/p&gt;
    &lt;/blockquote&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PS: Was done on Ubuntu 13.10 and Ubuntu 14.04.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Bringing your contacts to a Nokia 7110</title>
   <link href="/2013/12/bringing-your-contacts-to-nokia-7110.html"/>
   <updated>2013-12-12T20:29:00+01:00</updated>
   <id>/2013/12/bringing-your-contacts-to-nokia-7110</id>
   <content type="html">&lt;p&gt;I just needed a new phone and decided to go for cool solution: Nokia 7110 (v4.84).
I got one including serial data cable + dock and the only thing missing was: how do I get my contacts on the phone without typing?&lt;/p&gt;

&lt;p&gt;The answer was quite simply: export your address book as vCard and send it to the phone via gnokii on an Ubuntu.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Get your address book
Export it somehow: I tried Evolution as well as GMail web-interface (both work).&lt;/li&gt;
  &lt;li&gt;Get a serial port
Setting up the serial port on my Lenovo X60 was not straight forward, but now it works…
(Really depends on your hardware)&lt;/li&gt;
  &lt;li&gt;Connect to phone
Use &lt;em&gt;minicom&lt;/em&gt; and check if the phone replies to AT commands&lt;/li&gt;
  &lt;li&gt;Configure &lt;em&gt;gnokii&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ini&quot; data-lang=&quot;ini&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;nn&quot;&gt;[global]&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;port&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/dev/ttyS0&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;model&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;7110&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;connection&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;serial&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;use_locking&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;yes&lt;/span&gt;
&lt;span class=&quot;py&quot;&gt;serial_baudrate&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;9600&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;Use gnokii to &lt;a href=&quot;http://wiki.gnokii.org/index.php/User&apos;s_Guide#Phonebook_backup_and_restore&quot;&gt;read/write your address book&lt;/a&gt;
&lt;em&gt;gnokii –deletephonebook ME 1 200&lt;/em&gt;
&lt;em&gt;gnokii –writephonebook -o –vcard &amp;gt; addressbook.vcf&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img border=&quot;0&quot; height=&quot;180&quot; src=&quot;/images/nokia7110.jpg&quot; width=&quot;320&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The Nokia 7110 has a bug: the vCard-parser is &lt;a href=&quot;http://www.offiziere.ch/trust-us/ds/73/008.htm&quot;&gt;broken&lt;/a&gt;…
So, I needed to fix my addressbook: basically remove all not needed data (emails, addresses, birthdays etc.). I implemented a small python-script using &lt;a href=&quot;http://vobject.skyhouseconsulting.com/&quot;&gt;vObject&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It reads from &lt;em&gt;stdin&lt;/em&gt; and writes to &lt;em&gt;stdout&lt;/em&gt;:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;table&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;cat addressbook.vcf&lt;/td&gt;
        &lt;td&gt;python script.py&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;/blockquote&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c1&quot;&gt;#!/usr/bin/python
#encoding=UTF-8
&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;vobject&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sys&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;inspect&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;#Remove entries except in list for one vcard.
&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;vcard3_remove_all_entries_except&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;vcard&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;allowedEntries&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;tel&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;categories&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;entries_dict&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;vcard&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;contents&lt;/span&gt;
   &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;entries_dict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;keys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;():&lt;/span&gt;
       &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;allowedEntries&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
           &lt;span class=&quot;k&quot;&gt;del&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;entries_dict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;key&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;importedVCards&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;vobject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;readComponents&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sys&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;stdin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;readlines&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()))&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;nf&quot;&gt;while &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;vcard&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;importedVCards&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;next&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
        &lt;span class=&quot;nf&quot;&gt;vcard3_remove_all_entries_except&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;vcard&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;vcard&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;nf&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;vcard&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;serialize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;except&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Exception&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
            &lt;span class=&quot;nf&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;except&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;StopIteration&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;bp&quot;&gt;None&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Sync with style:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;table&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;cat contacts.vcf&lt;/td&gt;
        &lt;td&gt;python import.py&lt;/td&gt;
        &lt;td&gt;gnokii –writephonebook -o –vcard&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;/blockquote&gt;

&lt;p&gt;And a tutorial to clean the Nokia 7110 can be found &lt;a href=&quot;http://jimmyauw.com/2007/02/13/nokia-7110-disassembling/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Transcode MKV (h264) with multiple audio streams to MP4 (AAC)</title>
   <link href="/2013/12/transcode-mkv-h264-with-multiple-audio.html"/>
   <updated>2013-12-03T13:23:00+01:00</updated>
   <id>/2013/12/transcode-mkv-h264-with-multiple-audio</id>
   <content type="html">&lt;p&gt;Transcoding MKV containers using avconv to MP4, so that the files can be processed with Adobe Premiere. 
The following command copies the video stream (should already be in h264) and convert all audio streams to AAC. 
All audio streams are sampled to 6 channels (even if the source is only stereo).&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;avconv -i INPUT.mkv -c:v copy -map 0:0 -c:a aac -map 0:1 -map 0:2 -ab 448k -ac 6 OUTPUT.mp4&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The example is for 2 audio streams; just add more -map commands as needed.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>PJSIP 2.1 for Ubuntu (PPA) with video support</title>
   <link href="/2013/10/pjsip-for-ubuntu-ppa-with-video-support.html"/>
   <updated>2013-10-25T07:45:00+02:00</updated>
   <id>/2013/10/pjsip-for-ubuntu-ppa-with-video-support</id>
   <content type="html">&lt;p&gt;I am happy to announce that PJSIP 2.1 is packed for Ubuntu 13.10 including Video support.&lt;/p&gt;

&lt;p&gt;PPA here:
&lt;a href=&quot;https://launchpad.net/~dennis.guse/+archive/sip-tools&quot;&gt;https://launchpad.net/~dennis.guse/+archive/sip-tools&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On Ubuntu do the following:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;add-apt-repository ppa:dennis.guse/sip-tools
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get update
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;libpjsip-samples python-pjsip&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Samples reside then in &lt;em&gt;/usr/lib/libpjsip-samples/&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Features:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Python 2.7 bindings&lt;/li&gt;
  &lt;li&gt;SSL&lt;/li&gt;
  &lt;li&gt;&lt;em&gt;(new) Video support&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;&lt;em&gt;(new) vidgui sample application [is patched]&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Next steps:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Add x264&lt;/li&gt;
  &lt;li&gt;Python bindings: Add video support&lt;/li&gt;
  &lt;li&gt;Python bindings: Bump bindings to Python 3.X&lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>openHKP [initial release]</title>
   <link href="/2013/08/openhkp-initial-release.html"/>
   <updated>2013-08-12T09:50:00+02:00</updated>
   <id>/2013/08/openhkp-initial-release</id>
   <content type="html">&lt;p&gt;OpenHKP release mail send to openPGP.js:&lt;/p&gt;

&lt;p&gt;Hey,
first of all thanks for building openpgp.js!
Some weeks ago I started using openpgp.js and found it pretty convenient.
However, I missed one feature: the interaction with PGP-Keyserver.
Long story short: As the keyserver protocol (HKP) is basically HTTP, I created a brief implementation in Javascript:
&lt;a href=&quot;https://gitorious.org/openhkp-js/openhkp-js&quot;&gt;https://gitorious.org/openhkp-js/openhkp-js&lt;/a&gt;
Furthermore, I setup a CORS-enabled proxy for some keyservers:
&lt;a href=&quot;http://g00se.indus.uberspace.de/&quot;&gt;http://g00se.indus.uberspace.de/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The implementation is based upon:
&lt;a href=&quot;http://tools.ietf.org/html/draft-shaw-openpgp-hkp-00&quot;&gt;http://tools.ietf.org/html/draft-shaw-openpgp-hkp-00&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Asterisk: Accepted Patch</title>
   <link href="/2013/08/asterisk-accepted-patch.html"/>
   <updated>2013-08-02T08:47:00+02:00</updated>
   <id>/2013/08/asterisk-accepted-patch</id>
   <content type="html">&lt;p&gt;First contribution to Asterisk (implemented together with Frank Haase):&lt;/p&gt;

&lt;p&gt;&lt;em&gt;For video calls, we would like to set the codecs in the dialplan using *SIP_CODEC&lt;/em&gt;. However, if SIP_CODEC is set, all codecs except the ONE set are disallowed and thus either audio or video is available.Attached is a patch for 11.4 that allows SIP_CODEC to contain a list of codecs , e.g. “gsm,h264”.*&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://issues.asterisk.org/jira/browse/ASTERISK-21976&quot;&gt;https://issues.asterisk.org/jira/browse/ASTERISK-21976&lt;/a&gt; is accepted:
&lt;a href=&quot;https://reviewboard.asterisk.org/r/2728/&quot;&gt;https://reviewboard.asterisk.org/r/2728&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks to Matt Jordan and Rusty Newton (both Digium) for their reviews.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>PJSIP library package for Ubuntu</title>
   <link href="/2013/07/pjsip-library-package-for-ubuntu.html"/>
   <updated>2013-07-30T11:31:00+02:00</updated>
   <id>/2013/07/pjsip-library-package-for-ubuntu</id>
   <content type="html">&lt;p&gt;I find it pretty annoying to compile PJSIP on all hosts that I use by hand.
It is quite error-prone and the procedure is quite time-consuming.
So, I created the scripts to setup an Ubuntu packet (at the moment only 13.04). It is available as PPA here: &lt;a href=&quot;https://launchpad.net/~dennis.guse/+archive/sip-tools&quot;&gt;https://launchpad.net/~dennis.guse/+archive/sip-tools&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On Ubuntu do the following:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;sudo add-apt-repository ppa:dennisguse/sip-tools
sudo apt-get update
sudo apt-get install libpjsip-dev python-pjsip&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Features:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Python-bindings&lt;/li&gt;
  &lt;li&gt;SSL&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Missing Features:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Video (some dependencies are missing in Ubuntu 13.04 and will come with 13.10).&lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>Reverse proxy with CORS with Apache2</title>
   <link href="/2013/07/reverse-proxy-with-cors.html"/>
   <updated>2013-07-26T21:00:00+02:00</updated>
   <id>/2013/07/reverse-proxy-with-cors</id>
   <content type="html">&lt;p&gt;For the implementation of a Javascript-Client, I needed a CORS enabled reverse-proxy.&lt;/p&gt;

&lt;p&gt;Uses apache2 and mod_rewrite and mod_headers must be loaded.&lt;/p&gt;

&lt;p&gt;Via VirtualHost:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so

&amp;lt;virtualhost 127.0.0.1:80&amp;gt;
  ProxyRequests Off
  ProxyPass / http://URL
  ProxyPassReverse / http://URL
  
  Header set Access-Control-Allow-Origin &quot;*
  Header set Access-Control-Allow-Headers &quot;Origin, X-Requested-With, Content-Type, Accept&quot;

&amp;lt;/virtualhost&amp;gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Via .htaccess:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;RewriteEngine  on
RewriteBase /
RewriteRule  ^(.*)  http://URL  [P,L,QSA]

Header set Access-Control-Allow-Origin &quot;*&quot;
Header set Access-Control-Allow-Headers &quot;Origin, Content-Type, Accept&quot;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;PS: Be aware of the &lt;a href=&quot;http://statichtml.com/2011/mod_rewrite-proxy-caution.html&quot;&gt;security implications&lt;/a&gt;!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Macro-temporal development of QoE: impact of varying performance on QoE over multiple interactions</title>
   <link href="/publications/2013/daga-multi-episodic.html"/>
   <updated>2013-03-01T00:00:00+01:00</updated>
   <id>/publications/2013/daga-multi-episodic</id>
   <content type="html">
</content>
 </entry>
 
 <entry>
   <title>Pairing Bluetooth Keyboard on Windows and Linux using the same receiver</title>
   <link href="/2012/12/pairing-bluetooth-keyboard-on-windows.html"/>
   <updated>2012-12-29T19:48:00+01:00</updated>
   <id>/2012/12/pairing-bluetooth-keyboard-on-windows</id>
   <content type="html">&lt;p&gt;Found a solution on the web with authenticated connections &lt;a href=&quot;http://distangledpause.blogspot.de/2011/01/how-to-share-bluetooth-keyboard-between.html&quot;&gt;here&lt;/a&gt; (the original description is far more detailed).&lt;/p&gt;

&lt;p&gt;Short description (so that it is still available for me ;) ):&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Pair with (each) Linux&lt;/li&gt;
  &lt;li&gt;Pair with Windows&lt;/li&gt;
  &lt;li&gt;Extract authentication key from Windows from windows registry (stored in Windows/System32/config/system) using libhivex-bin&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;hivexml system | perl -ane &apos;s/&amp;amp;lt;/\n&amp;amp;lt;/g; print&apos; | grep -i &apos;key=&quot;YOUR BLUETOOTH ID WITHOUT : &quot;&apos;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;ul&gt;
  &lt;li&gt;Decode the content of xml-entity with Base64&lt;/li&gt;
  &lt;li&gt;Replace Linux authentication key with the extracteted version Linux /var/lib/bluetooth/RECEIVERID/linkkeys&lt;/li&gt;
  &lt;li&gt;Restart Bluetooth service&lt;/li&gt;
&lt;/ul&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;sudo service bluetooth restart&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;I can confirm that this works using Ubuntu 12.10 and Windows 8 with a Apple Wireless Keyboard.&lt;/p&gt;

&lt;p&gt;Alternative solution without authentication (I WOULD NOT RECOMMEND THIS FOR A KEYBOARD) can be found &lt;a href=&quot;http://www.wayneandlayne.com/blog/2010/06/14/bluetooth-keyboard-pairing-without-code-entry/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;UPDATE: Still works with 13.04&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>HTML JS publish click-events to all childs</title>
   <link href="/2012/12/html-js-publish-click-events-to-all.html"/>
   <updated>2012-12-28T15:46:00+01:00</updated>
   <id>/2012/12/html-js-publish-click-events-to-all</id>
   <content type="html">&lt;p&gt;I have tables with one radio button per cell and its quite annoying to aim at the radio button completely…&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;onclick=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;
  for (var i in this.childNodes)
    if(typeof this.childNodes[i].click === &apos;function&apos;) this.childNodes[i].click();&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;input&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;radio&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Just clickable text&lt;span class=&quot;nt&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

</content>
 </entry>
 
 <entry>
   <title>CSipSimple - Getting started to hack it (tailor to my needs)</title>
   <link href="/2012/12/csipsimple-getting-started-to-hack-it.html"/>
   <updated>2012-12-20T17:04:00+01:00</updated>
   <id>/2012/12/csipsimple-getting-started-to-hack-it</id>
   <content type="html">&lt;p&gt;Just one or two things I need to remember about &lt;a href=&quot;http://csipsimple.org/&quot;&gt;CSipSimple&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;Infrastructure:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;SipStack runs in background (communication via Parcable interface). It interacts with PJSIP.
Important there is a watchdog timer (about 5s)!&lt;/li&gt;
  &lt;li&gt;pjsua.java, pjsuaConstants is the SWIG generated interface to PJSIP&lt;/li&gt;
  &lt;li&gt;Native functions never return boolean, check for pjSuaConstants.PJ_SUCCESS&lt;/li&gt;
  &lt;li&gt;Be aware of string exchange with the native stack: PjSipService.pjStrToString(…)&lt;/li&gt;
  &lt;li&gt;UAStateReceiver.java does the call creation and everything related to SipStack&lt;/li&gt;
  &lt;li&gt;PjSipService.java is deeply integrated with UAStateReceiver.java (for example does recording…)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;UI:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;CustomDistribution.java defines some things for fast modifying the behavior&lt;/li&gt;
  &lt;li&gt;Main screen is created in SipHome.java (incl. the slidable tabs)
To remove tabs, just disable tab.add (except for the warning tab and the message tab [message disable in CustomDistribution.java]: may be triggered from outside)&lt;/li&gt;
  &lt;li&gt;Notifications are handled in SipNotifications.java (but from Sip-Thread)&lt;/li&gt;
  &lt;li&gt;DialerFragment.java is the dialer incl. call button and account switcher…
Here the re-dial functionality is missing… (press the call button twice without number should redial previous number)&lt;/li&gt;
  &lt;li&gt;InCallActivity.java :)
Important call setup is done BEFORE launching the InCallActivity via SipManager.ACTION_SIP_CALL_UI from UAStateReceiver.launchCallHandler(…).
There is even a activity start delay of 2000ms (UAStateReceiver.LAUNCH_TRIGGER_DELAY).
I think it’s not nice!!!! Because a user may hear sound of before the UI is ready, but there is might be a problem with race conditions…&lt;/li&gt;
  &lt;li&gt;InCallControls.java is the ui element on the bottom of InCallActivity to control Bluetooth and loudspeaker etc. (Deeply integrated with InCallActivity: sadly NO MVC…)&lt;/li&gt;
  &lt;li&gt;InCall.java is also related to Dialer&lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>Bluetooth Remote Control for Windows Media Center</title>
   <link href="/2012/11/bluetooth-remote-control-for-windows.html"/>
   <updated>2012-11-17T14:48:00+01:00</updated>
   <id>/2012/11/bluetooth-remote-control-for-windows</id>
   <content type="html">&lt;p&gt;After years of using my Bluetooth mouse to control Windows Media Center (WMC) from my couch - I figured out that I needed a proper remote control (actually I visited a friend who used the &lt;a href=&quot;http://windowsdevcenter.com/windows/2006/11/28/graphics/fig-21.jpg&quot;&gt;IR remote&lt;/a&gt; of WMC). After endless time of searching I found the PS3 remote (Sony employs Bluetooth &lt;em&gt;yeah&lt;/em&gt;) and it works with WMC using a small program that translates the game controller HID events to actual keystrokes.&lt;/p&gt;

&lt;p&gt;It is called &lt;a href=&quot;http://www.benbarron.com/applications&quot;&gt;PS3BluMote&lt;/a&gt; and written by Ben Barron.
As Ben’s website was not reachable, I compiled from using VS2012 - took me about 2min.
And it works perfectly - I only need to figure out good keymapping (WMC key shortcuts are available &lt;a href=&quot;http://windows.microsoft.com/en-us/windows-vista/Windows-Media-Center-keyboard-shortcuts&quot;&gt;here&lt;/a&gt;). In fact, I recommend to use for play/pause, skip and volume control the windows events (in PS3BlueMote: &lt;em&gt;Media_&lt;/em&gt;) and not the WMC shortcuts - in this way also VLC and other players can be controlled.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.howtogeek.com/howto/11614/startup-customizations-for-media-center-in-windows-7/&quot;&gt;Here&lt;/a&gt; are some additional startup options for WMC: I created a shortcut to go to the music section directly.&lt;/p&gt;

&lt;p&gt;PS: I use it on Windows 8 Pro with WMC&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>(Rails3) ActiveRecords: how to implement a constructor and init own attributes</title>
   <link href="/2012/11/rails3-activerecords-how-to-implement.html"/>
   <updated>2012-11-09T22:27:00+01:00</updated>
   <id>/2012/11/rails3-activerecords-how-to-implement</id>
   <content type="html">&lt;p&gt;Today I encountered two nasty things during Rails development. My idea was to create a generic model class (&amp;lt; ActiveRecord:Base) that on creation create the current timestamp.
It is not possible to override &lt;em&gt;initialize&lt;/em&gt; (at least it is doing nothing) as it is an ActiveRecord:Base.&lt;/p&gt;

&lt;p&gt;I found the callback after_initialize defined by ActiveRecord, which is however not the correct way anymore. You should use it in macro style (&lt;a href=&quot;http://stackoverflow.com/questions/4906704/how-to-use-after-initialize-in-rails-3&quot;&gt;source&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The next problem is that ActiveRecord overwrites the accessors and because ruby is not using the accessors by default if you are in the object, it must be called explicitely.
This works for me:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;A&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ActiveRecord&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;no&quot;&gt;Base&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;attr_accessible&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:a&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;after_initialize&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:init&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;init&lt;/span&gt;
    &lt;span class=&quot;vi&quot;&gt;@a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;a&quot;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;ss&quot;&gt;:a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;b&quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

</content>
 </entry>
 
 <entry>
   <title>Using GoogleDocs as Team editor for Latex-files</title>
   <link href="/2012/05/using-googledocs-as-team-editor-for.html"/>
   <updated>2012-05-30T11:46:00+02:00</updated>
   <id>/2012/05/using-googledocs-as-team-editor-for</id>
   <content type="html">&lt;p&gt;We wrote our last project paper using Latex which creates very nice looking documents, but is absolutely painful to work in teams. 
Even using a code management system like SVN/GIT won’t make it really comfortable as you don’t have &lt;em&gt;comments&lt;/em&gt; and see changes of other editors &lt;em&gt;live&lt;/em&gt;.
So, we put our Latex document in GoogleDocs (simply copied the content into a New GDocs Text Document) and shared it with our team. We also formatted the document by applying GDocs styles to our Latex headings, so the text looks structured and easier to work with.
At first we simply copied the GDocs content to a local file and compiled it. In fact, the copy-and-paste task is really annoying and so we developed a small bash script that automatically downloads the latest GDocs version and compiles it locally. So, in any case you need to setup your latex tools correctly, but don’t waste your time in the compilation step.
You only need to enable sharing by URL and from this URL copy the document id, which you need to download the file.
Here is the script:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;get -O soups-article.download “https://docs.google.com/document/export?format=txt&amp;amp;id=PLACE_YOUR_ID_HERE” &amp;amp;&amp;amp; &lt;br /&gt;
iconv -c –from-code=UTF-8 –to-code=ISO-8859-1 soups-article.download | sed ‘s/end{document}*/end{document}/’ &amp;gt; myFile.tex &amp;amp;&amp;amp; &lt;br /&gt;
pdflatex myFile &amp;amp;&amp;amp; &lt;br /&gt;
evince soups-article.pdf&lt;/p&gt;
&lt;/blockquote&gt;
</content>
 </entry>
 
 <entry>
   <title>Asterisk and MessageSend</title>
   <link href="/2012/05/asterisk-and-messagesend.html"/>
   <updated>2012-05-30T10:16:00+02:00</updated>
   <id>/2012/05/asterisk-and-messagesend</id>
   <content type="html">&lt;p&gt;We are using Asterisk (running on FreeBSD 9.0 port stock version: 10.0.0-rc2) as SIP registrar/proxy. 
We are using the Android softphone &lt;a href=&quot;https://code.google.com/p/csipsimple/&quot;&gt;cSipSimple&lt;/a&gt;, which also provides SIP SIMPLE messaging functionality. To enable this on Asterisk add to sip.conf: 
&lt;em&gt;accept_outofcallmessage=yes&lt;/em&gt; and &lt;em&gt;outofcall_message=message&lt;/em&gt; (the name of the context handler).&lt;/p&gt;

&lt;p&gt;However, we had some trouble setting up Asterisk to really do it. In the message-ctx Asterisk provides the information of the current message as variables/function: &lt;em&gt;MESSAGE(to)&lt;/em&gt;, &lt;em&gt;MESSAGE(from)&lt;/em&gt; and &lt;em&gt;MESSAGE(body)&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;(First problem) 
The first problem is that MESSAGE(to) contains the complete address, e.g. sip:PHONENUMBER@SERVERIP.
If you try to use this address asterisk sends the message to itself and complains on receive that their is no routing for the incoming message.
So, we need to remove the @IP part using the CUT command from the TO and the FROM.
Now we can send a message from one phone to another: MESSAGESEND(CUTED_TO, CUTED_FROM).&lt;/p&gt;

&lt;p&gt;(Second problem)
However, we cannot reply as the recipient got as sender address something like sip:UNKNOWN@SERVERIP.
In short use MESSAGESEND(CUTED_TO, CUTED_FROM &amp;lt;CUTED_FROM&amp;gt;) or as example MESSAGESEND(sip:1, SOMEBODY &amp;lt;1&amp;gt;).
The first part of the FROM is the name shown to the user and the second part the reply to phone number (without sip:).&lt;/p&gt;

&lt;p&gt;Here is our working context for messaging of the extensions.conf:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;[message]
  exten =&amp;gt; _X.,1,Set(TO=${CUT(MESSAGE(to),@,1)})
  exten =&amp;gt; _X.,n,Set(FROM=${CUT(MESSAGE(from),:,2)})
  exten =&amp;gt; _X.,n,Set(FROM_PHONE_NUMBER=${CUT(FROM,@,1)})
  exten =&amp;gt; _X.,n,MessageSend(${TO}, ${FROM_PHONE_NUMBER}&amp;amp;lt;${FROM_PHONE_NUMBER}&amp;amp;gt;)
  ;;DEBUG Print the status of the MessageSend
  exten =&amp;gt; _X.,n,Verbose(0, ${TO} ${MESSAGE(from)} ${FROM} ${MESSAGE_SEND_STATUS})
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Thanks to Nicolas.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>PalmSpace: continuous around-device gestures vs. multitouch for 3D rotation tasks on mobile devices</title>
   <link href="/publications/2012/avi-palmspace.html"/>
   <updated>2012-05-22T00:00:00+02:00</updated>
   <id>/publications/2012/avi-palmspace</id>
   <content type="html">
</content>
 </entry>
 
 <entry>
   <title>ShoeSense: A New Perspective on Hand Gestures and Wearable Applications</title>
   <link href="/publications/2012/chi-shoesense.html"/>
   <updated>2012-05-05T00:00:00+02:00</updated>
   <id>/publications/2012/chi-shoesense</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=htN6u7tWbHg&quot;&gt;Demo-video on Youtube&lt;/a&gt;&lt;/p&gt;

&lt;video src=&quot;/publications/hci-gestures/2012%20-%20AVI%20-%20Kratz,%20Rohs,%20Guse,%20M%C3%BCller,%20Bailly,%20Nischt%20-%20PalmSpace%3A%20continuous%20around-device%20gestures%20vs.%20multitouch%20for%203D%20rotation%20tasks%20on%20mobile%20devices%20-%20Video%20Gestures%201.webm&quot; controls&gt;&lt;/video&gt;

&lt;video src=&quot;/publications/hci-gestures/2012%20-%20AVI%20-%20Kratz,%20Rohs,%20Guse,%20M%C3%BCller,%20Bailly,%20Nischt%20-%20PalmSpace%3A%20continuous%20around-device%20gestures%20vs.%20multitouch%20for%203D%20rotation%20tasks%20on%20mobile%20devices%20-%20Video%20Gestures%202.webm&quot; controls&gt;&lt;/video&gt;
</content>
 </entry>
 
 <entry>
   <title>Gesture-based User Authentication on Mobile Devices using Accelerometer and Gyroscope</title>
   <link href="/publications/2012/master-thesis-informatiktage.html"/>
   <updated>2012-05-01T00:00:00+02:00</updated>
   <id>/publications/2012/master-thesis-informatiktage</id>
   <content type="html">
</content>
 </entry>
 
 <entry>
   <title>Master-Thesis Template</title>
   <link href="/2011/12/master-thesis-template.html"/>
   <updated>2011-12-04T12:36:00+01:00</updated>
   <id>/2011/12/master-thesis-template</id>
   <content type="html">&lt;p&gt;Recently some of friends started to work on their theses and why reinvent a new Word Template every time?
So today, I finally found the time to strip down my master thesis word document and made it a &lt;a href=&quot;/publications/thesis-template.dotx&quot;&gt;word template&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I used and created it with Word 2010.&lt;/p&gt;

&lt;p&gt;It has:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Automatic lists for figures, tables (use stylesheets)&lt;/li&gt;
  &lt;li&gt;Automatic table of contents (use stylesheets)&lt;/li&gt;
  &lt;li&gt;Automatic page numbering (small latin for lists and ToC; arabic for text; big latin for the appendix)&lt;/li&gt;
  &lt;li&gt;Automatic title of the current chapter on each text page.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You need:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Something to write about&lt;/li&gt;
  &lt;li&gt;Know how to use style sheets in word&lt;/li&gt;
  &lt;li&gt;Somebody who reads your final text for mistakes&lt;/li&gt;
  &lt;li&gt;and at last a covering page&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feel free to use it and don’t waste your time creating yet another word thesis template.
And also feel free to modify and extend it.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Swissranger 4000 and OpenCV and Point Cloud Library</title>
   <link href="/2011/11/swissranger-4000-and-opencv-and-point.html"/>
   <updated>2011-11-10T14:25:00+01:00</updated>
   <id>/2011/11/swissranger-4000-and-opencv-and-point</id>
   <content type="html">&lt;p&gt;I am back on working with Depth Cameras and hand gesture recognition - now we are using a Swissranger SR4000 - a TOF camera - instead a Kinect. Here is demo code to get the camera data to OpenCV as well as Point Cloud Library.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-c&quot; data-lang=&quot;c&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;cm&quot;&gt;/**
* Demo program for the SR4k that shows the output (DepthImage and PCL) and can export these as images.
* Use SPACE to take a picture and ESC for end.
* @author Dennis Guse
*/&lt;/span&gt;

&lt;span class=&quot;cp&quot;&gt;#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&amp;lt;string&amp;gt;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&amp;lt;time.h&amp;gt;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&quot;opencv2/core/core.hpp&quot;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&quot;opencv2/highgui/highgui.hpp&quot;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&quot;opencv2/imgproc/imgproc.hpp&quot;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&quot;opencv2/imgproc/imgproc_c.h&quot;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;//SR4k&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&quot;libMesaSR.h&quot;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&quot;definesSR.h&quot;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&quot;pcl/point_cloud.h&quot;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&quot;pcl/point_types.h&quot;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
#include&lt;/span&gt; &lt;span class=&quot;cpf&quot;&gt;&quot;pcl/visualization/cloud_viewer.h&quot;&lt;/span&gt;&lt;span class=&quot;cp&quot;&gt;
&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;namespace&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;namespace&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;std&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;using&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;namespace&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pcl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;cp&quot;&gt;#define SR_ROWS 176
#define SR_COLS 144
&lt;/span&gt;&lt;span class=&quot;cm&quot;&gt;/**
 * Takes a picture with the SR4k and returns the depthimage as well as the point cloud!
 */&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;cv&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Mat&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;takePicture&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SRCAM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;srCam&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pcl&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointCloud&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pcl&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointXYZ&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Ptr&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cloud&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;SR_Acquire&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;srCam&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;cv&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Mat&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;depthImage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SR_ROWS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SR_COLS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SR_CV_PIXELTYPE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;short&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SR_GetImage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;srCam&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//0:DepthImage; 1:Amplitude; 2:ConfidenceMap&lt;/span&gt;

 &lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SR_ROWS&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SR_COLS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
 &lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SR_ROWS&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SR_COLS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
 &lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;z&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SR_ROWS&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SR_COLS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;SR_CoordTrfFlt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;srCam&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;sizeof&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;sizeof&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;sizeof&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;

 &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;SR_ROWS&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SR_COLS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;point&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;point&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;point&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;z&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;point&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;gt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;points&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;push_back&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;point&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
 &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
 &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;depthImage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;argc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;argv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;SRCAM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;srCam&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;SR_OpenETH&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;amp&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;srCam&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;SR_IP_ADDR&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//Add error handling&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;SR_SetMode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;srCam&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;AM_COR_FIX_PTRN&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AM_CONV_GRAY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AM_DENOISE_ANF&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;AM_CONF_MAP&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

 &lt;span class=&quot;n&quot;&gt;pcl&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;visualization&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;CloudViewer&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;viewer&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;PCLViewer&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
 &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;pcl&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointCloud&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pcl&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pointxyz&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Ptr&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cloud&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pcl&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointCloud&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pcl&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pointxyz&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;cv&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Mat&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;depthImage&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;takePicture&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;srCam&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cloud&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;cv&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;imshow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Depth&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;depthIamge&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;viewer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;showCloud&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cloud&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Cloud&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

  &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;waitKey&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;KEY_ESC&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;key&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;saveDepthImageAndCloud&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;depthImage&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cloud&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
 &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

</content>
 </entry>
 
 <entry>
   <title>Lenovo X60 and Ericcson F5521gw</title>
   <link href="/2011/09/lenovo-x60-and-ericcson-f5521gw.html"/>
   <updated>2011-09-13T16:15:00+02:00</updated>
   <id>/2011/09/lenovo-x60-and-ericcson-f5521gw</id>
   <content type="html">&lt;p&gt;My old Lenovo X60 (wwan ready: antenna an sim slot available) uses the current state of the art UMTS (mini pci express) card from Ericcson. The card orignally belongs to an Lenovo W520 - FRU is 60Y3279.&lt;/p&gt;

&lt;p&gt;!I am using the original BIOS (no zender!)&lt;/p&gt;

&lt;p&gt;Basically:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Download drivers for the card from Lenovo&lt;/li&gt;
  &lt;li&gt;Extract drivers (the .exe complains that my X60 is not supported) using InstallShield tools&lt;/li&gt;
  &lt;li&gt;Cover pin 20 on the card with scotch tape. (Drawback: card cannot be turned off)&lt;/li&gt;
  &lt;li&gt;Plugin the card (I am using only the main antenna)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hint:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Even with pin 20 enabled (no scotch) my notebook booted without error 180X and windows showed it in the device manager - but cannot be turned on!&lt;/li&gt;
  &lt;li&gt;Fn+F5 (Access Connection) does not show the card, but the connection can be configured.&lt;/li&gt;
  &lt;li&gt;Access Connection can turn the card off (probably via AT commands)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PIN 20: Not my image; credits go to the unknown creator (&lt;em&gt;Update: Link is down.&lt;/em&gt;; Link removed).&lt;/p&gt;

&lt;p&gt;Any question: Leave a comment with your mail-addr.&lt;/p&gt;

&lt;p&gt;PS: In comparison to WiFi tethering with my Palm Pre: the card is awesome fast! (using O2 max. 3.6 Mbit/s)&lt;/p&gt;

&lt;p&gt;Update:
&lt;a href=&quot;http://www.sbbala.com/DellWWAN/Dell5530.htm&quot;&gt;Similar guide for Dell and a WWAN&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.kanmandet.dk/?p=1287&quot;&gt;Extract drivers from encrypted install shield archives&lt;/a&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Gesture-based User Authentication on Mobile Devices using Accelerometer and Gyroscope</title>
   <link href="/publications/2011/master-thesis-mobilhci.html"/>
   <updated>2011-09-01T00:00:00+02:00</updated>
   <id>/publications/2011/master-thesis-mobilhci</id>
   <content type="html">
</content>
 </entry>
 
 <entry>
   <title>Gesture-based User Authentication on Mobile Devices using Accelerometer and Gyroscope</title>
   <link href="/publications/2011/master-thesis.html"/>
   <updated>2011-05-01T00:00:00+02:00</updated>
   <id>/publications/2011/master-thesis</id>
   <content type="html">
</content>
 </entry>
 
 <entry>
   <title>Matlab: Progressbar for arrayfun</title>
   <link href="/2011/02/matlab-progressbar-for-arrayfun.html"/>
   <updated>2011-02-04T21:24:00+01:00</updated>
   <id>/2011/02/matlab-progressbar-for-arrayfun</id>
   <content type="html">&lt;p&gt;If you use &lt;em&gt;arrayfun&lt;/em&gt; on large arrays with really slow functions it is annoying to wait without feedback how long it can take - so a progressbar (in matlab waitbar) would be nice. One problem is that arrayfun provides no information about the status - there are no callback handlers.
What could be done instead.
Simply write function for arrayfun as inner function of the function which calls arrayfun. In the calling function
you define two variables, one for the number of items and one for the current solved items (starts with 0 and gets updated). In the inner function the work is done and the counter increment, which is visible in the inner function, because it is an inner function. At last update the waitbar.
Here is how it can look:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-matlab&quot; data-lang=&quot;matlab&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;doArrayFunWithProgressBar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;magic&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;35&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;WAITBAR&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;waitbar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&apos;Work in progress&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;PROGRESS_COUNTER&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;PROGRESS_MAX&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;arrayfun&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;innerFun&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

  &lt;span class=&quot;nb&quot;&gt;close&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;WAITBAR&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;innerFun&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;item&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; 
    &lt;span class=&quot;c1&quot;&gt;%TODO Do the work!&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;pause&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;PROGRESS_COUNTER&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;PROGRESS_COUNTER&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;waitbar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PROGRESS_COUNTER&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;PROGRESS_MAX&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

</content>
 </entry>
 
 <entry>
   <title>Matlab: if-statement in anonymous functions</title>
   <link href="/2011/01/matlab-if-statement-in-anonymous.html"/>
   <updated>2011-01-27T10:36:00+01:00</updated>
   <id>/2011/01/matlab-if-statement-in-anonymous</id>
   <content type="html">&lt;p&gt;&lt;em&gt;UPDATE: The performance penalty is massive - MATLAB fails to optimize the code if anonymous functions or function handles are used. I got factor 20… But it works ;)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Today, I needed to write a function in Matlab as accessor to a matrix. I have a matrix which contain mulitple datastreams - one per row. The columns dimension is the time
Because I don’t want to change the functions, which evaluate only a subset of provided streams, and I don’t want to copy and modify the matrix for every combination, I started to think about an accessor function.
Furthermore the function should reveal the dimensions of the (not existing) data matrix.
I ended up with anonymous functions, because these allow to access variables outside the anonymous function definition like:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-matlab&quot; data-lang=&quot;matlab&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;  &lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt; 
  &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt; 
  &lt;span class=&quot;n&quot;&gt;fun&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=@&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; 
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The advantage is that &lt;em&gt;fun&lt;/em&gt; can use &lt;em&gt;a&lt;/em&gt; and &lt;em&gt;b&lt;/em&gt;, but the caller doesn’t necessarily know that they exist and are used by &lt;em&gt;fun&lt;/em&gt;.
With this knowledge the implementation of providing the correct data was straight forward. The next problem was, that in anonymous function you can’t use the if-statement. That’s pretty messy.
I found a (solution)[http://www.mathworks.com/matlabcentral/newsreader/view_thread/147044] and adapted it.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-matlab&quot; data-lang=&quot;matlab&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c1&quot;&gt;%%Artificial if for use in anonymous functions&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;%TRUE and FALSE are function handles.&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;RESULT&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;iff&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;CONDITION&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;FALSE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;CONDITION&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;RESULT&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;RESULT&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;FALSE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The function that creates the function handles of the accessor function:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-matlab&quot; data-lang=&quot;matlab&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;HANDLE&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;recordHandle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;COLUMN&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ROWS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;HANDLE&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;...&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;iff&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;nargin&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;COLUMN&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ROWS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()[&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;COLUMN&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ROWS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)])&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;...&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

</content>
 </entry>
 
 <entry>
   <title>Apple Wireless Keyboard on Windows [AppleKeyboardInstaller.exe]</title>
   <link href="/2010/08/apple-wireless-keyboard-on-windows.html"/>
   <updated>2010-08-30T07:02:00+02:00</updated>
   <id>/2010/08/apple-wireless-keyboard-on-windows</id>
   <content type="html">&lt;p&gt;At the weekend I found a solution to a long lasting problem of mine. I have a Apple Wireless Keyboard, because two years ago it was the best Bluetooth keyboard on the market (Currently I can’t say, didn’t checked again). So, I use the keyboard every day mostly for writing text ;), but the device doens’t posess a DEL, POS1 and END-Key and thus it is hard to navigate during typing.&lt;/p&gt;

&lt;p&gt;The solution is install the keyboard driver provided by Apple in the Bootcamp package. The driver I use is from a OS X Leopard installation disc.
Or download it here:
&lt;a href=&quot;http://www.happytocode.com/post/Apple-Aluminium-keyboard-Boot-Camp-20-Windows-drivers.aspx&quot;&gt;http://www.happytocode.com/post/Apple-Aluminium-keyboard-Boot-Camp-20-Windows-drivers.aspx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;PS: After I found the solution myself, I had the correct google search term and solutions older than my keyboard. But it works.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;UPDATE:
The keyboard driver sometimes leads to Bluescreens, so I am back using the standard windows drivers without the additional keyboard shortcuts.&lt;/em&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Credit card: Visualize your money</title>
   <link href="/2010/08/credit-card-visualize-your-money.html"/>
   <updated>2010-08-06T12:48:00+02:00</updated>
   <id>/2010/08/credit-card-visualize-your-money</id>
   <content type="html">&lt;p&gt;Some time ago I had a discussion about (dis-)advantages of physical against non-physical stuff. She argued that non-physical is mostly too abstract for the user and thus not that easy to use in daily life.
We argued about “real” money as physical and credit cards as non-physical example. The advantages of real money are that you see what you have and you can only spend that. The advantages of the credit card are that the payment is easier and payment via internet is possible.&lt;/p&gt;

&lt;p&gt;The main disadvantage is that you as user can’t see how much money you spend or you have available. The card looks always the same.&lt;/p&gt;

&lt;p&gt;Assume that materials are available that could either shrink or change it’s color. Using this the credit card will get smaller if you pay with it and slowly reach your limit. Or the card could get &lt;em&gt;orange&lt;/em&gt; if are in reaching line of credit and &lt;em&gt;red&lt;/em&gt; if your are in.
Thus you as user would “feel” how much money is available and it is much easier to cope with the abstraction from real money.&lt;/p&gt;

&lt;p&gt;PS: Only an experiment in mind.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Windows shell (cmd) and loops</title>
   <link href="/2010/06/windows-shell-cmd-and-loops.html"/>
   <updated>2010-06-14T17:32:00+02:00</updated>
   <id>/2010/06/windows-shell-cmd-and-loops</id>
   <content type="html">
&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-powershell&quot; data-lang=&quot;powershell&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;kr&quot;&gt;FOR&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;in&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kr&quot;&gt;DO&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; 
  &lt;/span&gt;&lt;span class=&quot;kr&quot;&gt;FOR&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;IN&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kr&quot;&gt;DO&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ECHO&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;g&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Hopefully I have never to use the windows shell again!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>JSF 2.0: Mojarra and multipart/form-data (File Upload) [Glassfish]</title>
   <link href="/2010/03/jsf-20-mojarra-and-multipartform-data.html"/>
   <updated>2010-03-29T10:19:00+02:00</updated>
   <id>/2010/03/jsf-20-mojarra-and-multipartform-data</id>
   <content type="html">&lt;p&gt;It is a quite a mess that Mojarra doesn’t support h:forms that use enctyp multipart/form-data, because you can’t access possible available parts in the JSF Controllers.&lt;/p&gt;

&lt;p&gt;The following wrapper extends a HttpServletRequest so that getParameter also uses available data in HttpServletRequest.getParts().&lt;/p&gt;

&lt;p&gt;You can than access the HttpServletRequest via
FacesContext.getCurrentInstance().getExternalContext() and use getParts own your own.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;java.io.BufferedReader&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;java.io.IOException&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;java.io.InputStream&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;java.io.InputStreamReader&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;java.util.HashMap&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;java.util.Map&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;java.util.logging.Level&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;java.util.logging.Logger&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;javax.servlet.ServletException&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;javax.servlet.http.HttpServletRequest&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;javax.servlet.http.HttpServletRequestWrapper&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;javax.servlet.http.Part&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;cm&quot;&gt;/**
 * The mojarra implementation does not parse POST request that are multipart encoded, 
 * because the parameters are not accessable via &amp;lt;code&amp;gt;getParameter()&amp;lt;/code&amp;gt;.
 *
 * This class extends the HttpServletRequest to provide access to the parameters
 * which are encoded accessable via &amp;lt;code&amp;gt;getParts&amp;lt;/code&amp;gt;.
 *
 * All parts are made visible that have &amp;lt;code&amp;gt;contentType == null &amp;amp;&amp;amp; size &amp;lt; 300&amp;lt;/code&amp;gt;.
 *
 * If the request is not multipart encoded, the wrapper doesn&apos;t modify the behavior of the original &amp;lt;code&amp;gt;HttpServletRequest&amp;lt;/code&amp;gt;.
 * @author dennis
 */&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;MultipartHTTPServletRequest&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;HttpServletRequestWrapper&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;

    &lt;span class=&quot;kd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Map&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parameterParts&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;HashMap&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;();&lt;/span&gt;

    &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;MultipartHTTPServletRequest&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;HttpServletRequest&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;kd&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;

        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;getContentType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(!&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;getContentType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;toLowerCase&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;startsWith&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;multipart/&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Part&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;getParts&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getContentType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getSize&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;300&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
                    &lt;span class=&quot;n&quot;&gt;parameterParts&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;put&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getName&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(),&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;getData&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getInputStream&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()));&lt;/span&gt;
                &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
            &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;IOException&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ex&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;nc&quot;&gt;Logger&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getLogger&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;MultipartHTTPServletRequest&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getName&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()).&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Level&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;SEVERE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ex&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;catch&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;ServletException&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ex&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;nc&quot;&gt;Logger&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getLogger&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;MultipartHTTPServletRequest&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getName&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()).&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Level&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;SEVERE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ex&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;kd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;getData&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;InputStream&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;throws&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;IOException&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;line&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;nc&quot;&gt;BufferedReader&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;reader&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;BufferedReader&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;InputStreamReader&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;input&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;));&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;line&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;reader&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;readLine&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;())&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;line&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;nd&quot;&gt;@Override&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;getParameter&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getParameter&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;null&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;parameterParts&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

</content>
 </entry>
 
 <entry>
   <title>Java Servlet (3.0): How can I access multipart encoded content provided by a http post request?</title>
   <link href="/2010/03/java-servlet-30-how-can-i-access.html"/>
   <updated>2010-03-20T15:28:00+01:00</updated>
   <id>/2010/03/java-servlet-30-how-can-i-access</id>
   <content type="html">&lt;p&gt;At the last friday i stood right before a tricky problem: How can I save a image provided via HTTP post into a database?
I had three problems:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;How to upload a file via HTML?&lt;/li&gt;
  &lt;li&gt;How to access the data at the server side?&lt;/li&gt;
  &lt;li&gt;How to put in the database using JPA?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first one was easy, just create a html form add a input field (type=’file’) and a submit button.&lt;/p&gt;

&lt;p&gt;The second one cost me one day. And it was really simple: 
Just place the @MultipartConfig annotation at the class definition of the servlet and use HTTPRequest.getPart[s]() methods to access the data as an inputstream.&lt;/p&gt;

&lt;p&gt;The last part was straight forward: use a InputStreamReader to copy the data into a byte[] and add @Lob byte[] field to the entity class.&lt;/p&gt;

&lt;p&gt;Because I use MySQL it was necessary to change the columnt type from TEXT to MEDIUMBLOB.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Java: CDI &amp;amp; ConversationScope</title>
   <link href="/2010/02/java-cdi-conversationscope.html"/>
   <updated>2010-02-07T16:25:00+01:00</updated>
   <id>/2010/02/java-cdi-conversationscope</id>
   <content type="html">&lt;p&gt;Yesterday I recreated my web app project with maven. Now CDI is available and &lt;a href=&quot;http://java.sun.com/javaee/6/docs/api/javax/enterprise/context/ConversationScoped.html&quot;&gt;@ConversationScoped&lt;/a&gt; is really nice and makes the development a lot easier.
I used Glassfish v3.&lt;/p&gt;

&lt;p&gt;… Post my pom.xml tomorrow again.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Goodbye 85.214.89.182 (g00se.org)</title>
   <link href="/2009/11/goodbye-8521489182-g00seorg.html"/>
   <updated>2009-11-15T22:06:00+01:00</updated>
   <id>/2009/11/goodbye-8521489182-g00seorg</id>
   <content type="html">&lt;p&gt;It’s the last day of my good old vServer for g00se.org.
Tonight they will come and cut him off.&lt;/p&gt;

&lt;p&gt;To keep him in memory &lt;a href=&quot;http://old.g00se.org/&quot;&gt;old.g00se.org&lt;/a&gt; points to his former home adress.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Windows 7: Share your internet uplink via wireless ad-hoc network (ICS)</title>
   <link href="/2009/11/windows-7-share-your-internet-uplink.html"/>
   <updated>2009-11-14T23:48:00+01:00</updated>
   <id>/2009/11/windows-7-share-your-internet-uplink</id>
   <content type="html">&lt;p&gt;Scenario:
You have one windows 7 device with a direct internet connection like UMTS and you won’t to share the connection via an ad-hoc wireless network with another device. In my case it is a XDA neo.
Everything happens in the &lt;em&gt;Network and Sharing center&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Properties section of the network device with the uplink:
under sharing active ICS and re-connect the device to internet&lt;/li&gt;
  &lt;li&gt;Create a new ad-hoc network (use encryption!)&lt;/li&gt;
  &lt;li&gt;Join with another device the network&lt;/li&gt;
  &lt;li&gt;Set the wireless ad-hoc network location to &lt;em&gt;Home&lt;/em&gt;&lt;/li&gt;
  &lt;li&gt;Disconnect from the ad-hoc network and rejoin (device with uplink)The internet sharing should now work.&lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>Ubuntu-vm-builder default login</title>
   <link href="/2009/10/today-i-created-ubuntu-virtual-machines.html"/>
   <updated>2009-06-01T16:18:00+02:00</updated>
   <id>/2009/10/today-i-created-ubuntu-virtual-machines</id>
   <content type="html">&lt;p&gt;Today I created a ubuntu virtual machines with &lt;em&gt;ubuntu-vm-builder&lt;/em&gt;. When I tried to login nothing worked. I searched the web and found only the parameter –username, –password and –name. But I can’t recreate two VM using an UMTS uplink :(.&lt;/p&gt;

&lt;p&gt;I booted one machine (ubuntu jaunty VM) and used the &lt;a href=&quot;http://ubuntuforums.org/archive/index.php/t-3609.html&quot;&gt;password reset procedure&lt;/a&gt; to get a running root shell. In the passwd I found a user ubuntu. I rebooted and used ubuntu:ubuntu as credentials.&lt;/p&gt;

&lt;p&gt;Default username: ubuntu&lt;/p&gt;

&lt;p&gt;Default password: ubuntu&lt;/p&gt;

&lt;p&gt;Thanks to NO documentation and man pages for ubuntu-vm-builder…&lt;/p&gt;

&lt;p&gt;Addon:
The packet is named &lt;em&gt;python-vm-builder&lt;/em&gt;. See also &lt;a href=&quot;https://help.ubuntu.com/community/JeOSVMBuilder&quot;&gt;https://help.ubuntu.com/community/JeOSVMBuilder&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>CSS cheat sheet</title>
   <link href="/2009/05/css-cheat-sheet.html"/>
   <updated>2009-05-09T23:18:00+02:00</updated>
   <id>/2009/05/css-cheat-sheet</id>
   <content type="html">&lt;p&gt;Found by SOW: &lt;a href=&quot;http://kern.comelio.com/downloads/Kurzreferenzen/comelio_css_referenz_01_gross.jpg&quot;&gt;CSS cheat sheet&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>SQL cheat sheet</title>
   <link href="/2009/05/sql-cheat-sheet.html"/>
   <updated>2009-05-09T23:17:00+02:00</updated>
   <id>/2009/05/sql-cheat-sheet</id>
   <content type="html">&lt;p&gt;Found by SOW: &lt;a href=&quot;http://kern.comelio.com/downloads/Kurzreferenzen/comelio_sql_referenz_01_gross.jpg&quot;&gt;SQL cheat sheet&lt;/a&gt;&amp;lt;/a&amp;gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>HTML cheat sheet</title>
   <link href="/2009/05/html-cheat-sheet.html"/>
   <updated>2009-05-09T23:16:00+02:00</updated>
   <id>/2009/05/html-cheat-sheet</id>
   <content type="html">&lt;p&gt;Found by SOW: &lt;a href=&quot;http://kern.comelio.com/downloads/Kurzreferenzen/comelio_html_referenz_01_gross.jpg&quot;&gt;HTML cheat sheet&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>PHP cheat sheet</title>
   <link href="/2009/05/php-cheat-sheet.html"/>
   <updated>2009-05-09T23:15:00+02:00</updated>
   <id>/2009/05/php-cheat-sheet</id>
   <content type="html">&lt;p&gt;Found by SOW: &lt;a href=&quot;http://kern.comelio.com/downloads/Kurzreferenzen/comelio_php_referenz_01_gross.jpg&quot;&gt;PHP cheat sheet&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Power consumption of the internet</title>
   <link href="/2009/05/power-consumption-of-internet.html"/>
   <updated>2009-05-03T23:19:00+02:00</updated>
   <id>/2009/05/power-consumption-of-internet</id>
   <content type="html">&lt;p&gt;Nice &lt;a href=&quot;http://www.guardian.co.uk/technology/2009/may/03/internet-carbon-footprint&quot;&gt;article&lt;/a&gt;….&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>SIP client for Windows (using ekiga SIP service)</title>
   <link href="/2009/01/sip-client-for-windows-using-ekiga-sip.html"/>
   <updated>2009-01-25T00:20:00+01:00</updated>
   <id>/2009/01/sip-client-for-windows-using-ekiga-sip</id>
   <content type="html">&lt;p&gt;After long time of crawling the web, I have found a solution to use the ekiga.net SIP service from Windows. Many of my friends use skype, but it is an annoying part of software. So I started using ekiga and ekiga.net as provider.
Microsoft itselfs provides a SIP client (netmeeting). The developer of Ekiga provides a nice &lt;a href=&quot;http://wiki.ekiga.org/index.php/Connecting_Windows_Messenger_5.1_to_ekiga.net&quot;&gt;howto&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Getting DBUS Messages from Networkmanager (Python)</title>
   <link href="/2009/01/getting-dbus-messages-from.html"/>
   <updated>2009-01-12T00:21:00+01:00</updated>
   <id>/2009/01/getting-dbus-messages-from</id>
   <content type="html">&lt;p&gt;I had some spare time and so I started playing with DBUS. I was annoyed that after NetworkManager established a connection I always start the same programs like ekiga, pidgin, firefox and evolution. So I wrote a small python program that start software if the NetworkManager singals an open connection via DBUS. The NetworkManager DBUS-API is &lt;a href=&quot;http://vidner.net/martin/software/cnetworkmanager/spec.html&quot;&gt;available&lt;/a&gt;. The hardest part was to find the docs.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;c1&quot;&gt;#!/usr/bin/python
&lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dbus.mainloop.glib&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DBusGMainLoop&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;gobject&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dbus&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;subprocess&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;signal_deviceNowActive&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;):&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;None&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dbus&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;State&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;subprocess&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Popen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;ps -C pidgin&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; || pidgin &amp;amp;amp;&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;shell&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;subprocess&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Popen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;ps -C ekiga&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp; || ekiga &amp;amp;amp;&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;shell&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;subprocess&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;Popen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;ps -C evolution || evolution &amp;amp;amp;&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;shell&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;init loop&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;DBusGMainLoop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;set_as_default&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;loop&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;gobject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;MainLoop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;init dbus&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;dbus&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;SystemBus&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;add_signal_receiver&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;signal_deviceNowActive&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;signal_name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dbus_interface&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;org.freedesktop.NetworkManager.Connection.Active&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;start loop&lt;/span&gt;&lt;span class=&quot;sh&quot;&gt;&quot;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;loop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;run&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;//*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;UPDATE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;thanks&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;your&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;comment&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

</content>
 </entry>
 
 <entry>
   <title>Cort Dougan: Good Programmers are Not Lazy</title>
   <link href="/2008/12/cort-dougan-good-programmers-are-not.html"/>
   <updated>2008-12-30T00:24:00+01:00</updated>
   <id>/2008/12/cort-dougan-good-programmers-are-not</id>
   <content type="html">&lt;p&gt;Made me knowingly &lt;a href=&quot;http://hq.fsmlabs.com/%7Ecort/papers/lazy/lazy.nohead.html&quot;&gt;smile&lt;/a&gt;…&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Book: Domain-Driven Design (Eric Evans)</title>
   <link href="/2008/07/book-domain-driven-design-eric-evans.html"/>
   <updated>2008-07-11T23:26:00+02:00</updated>
   <id>/2008/07/book-domain-driven-design-eric-evans</id>
   <content type="html">&lt;p&gt;In the last summer (‘08) I had the time to read that book. A friend of mine (thanks to Thorben) suggested that the book is really worth a try. The cover says: “Tackling complexity in the Heart of Software”. And that is a really summary.&lt;/p&gt;

&lt;p&gt;Evans describes with short examples situations in software development projects which can lead to critical problems later.
He uses the short stories to analyze the situation, make the problem and cause clear.
Based upon that he describes a pattern (a style to develop software; mostly organizational stuff) to get rid of it.&lt;/p&gt;

&lt;p&gt;The first one he suggests is a “ubiquitous language”.
In short he says that all people connected to the project should use the same language, so that everyone can talk to everyone about the domain. That is not about technical stuff or infrastructure.
It is mere that all know all what the software should / will be used to.&lt;/p&gt;

&lt;p&gt;It’s a quite good book with well choosen practical examples and it helped to understand that real development differs from educational stuff in a sense of organization, time and size. It would have been helpful, if I read it earlier.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Lecture: Open Wins – the Future of Software &amp;amp; Technology (Scott McNealy, SUN)</title>
   <link href="/2008/06/lecture-open-wins-future-of-software.html"/>
   <updated>2008-06-13T23:27:00+02:00</updated>
   <id>/2008/06/lecture-open-wins-future-of-software</id>
   <content type="html">&lt;p&gt;Scott McNealy the chairmen and a co-founder of SUN visited the &lt;a href=&quot;http://www.tu-berlin.de/&quot;&gt;TU Berlin&lt;/a&gt; on 06-11-08. He visited the university to give a short talk about open source software and why it became and will be  a pushing element for technical innovations. Because he is with SUN the content of the talk was mostly about how SUN was, is and will be involved in the development of open source.
The essance of the talk was:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Open Source is good (not only code, also products and especially specifications)&lt;/li&gt;
  &lt;li&gt;reducing the dependency between the developer and the user&lt;/li&gt;
  &lt;li&gt;programmers improve their code style (someone else can read your stuff)&lt;/li&gt;
  &lt;li&gt;Strategy of SUN&lt;/li&gt;
  &lt;li&gt;He anwsered the question why SUN is doing open-source&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Interesting points:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Java&lt;/li&gt;
  &lt;li&gt;happens transparently (ref: mobile phone and blue-ray players)&lt;/li&gt;
  &lt;li&gt;is running on 6^9 devices (hope I got it right)&lt;/li&gt;
  &lt;li&gt;Oracle Enterprise Edition costs 400.000 $ per core(!)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cool quotes:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;“Free is the new black!”&lt;/li&gt;
  &lt;li&gt;“Return on no-investment.”&lt;/li&gt;
  &lt;li&gt;“Steal software legally”&lt;/li&gt;
  &lt;li&gt;“We don’t want you to do .NET! Watch your hands!”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Provided links during the talk:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://netbeans.tv/&quot;&gt;Netbeans.tv&lt;/a&gt;: the community site of Netbeans.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://developers.sun.com/sxde&quot;&gt;Solaris Express Developer Edition (SXDE)&lt;/a&gt;: A developer edition of solaris with many tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All in all I can say that Scott is a really good entertainer. It was a really nice talk!
Thanks to Prof. Brandenburg for the information.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>JTree on an JScrollPane and resizing</title>
   <link href="/2009/10/jtree-on-jscrollpane-and-resizing.html"/>
   <updated>2008-05-25T23:40:00+02:00</updated>
   <id>/2009/10/jtree-on-jscrollpane-and-resizing</id>
   <content type="html">&lt;p&gt;Early on the morning I read my early morning bug reports ;).
It was about an JTree on a JScrollPane. The model of the will be modified during runtime and fires events if something is changes. So far everything looks pretty straight forward and it works.
The problem occured if the tree gots larger than the parent scrollpane, so I believed the scrollpane starts to activate the scrollbars and everything stays cool… But the tree never changed it’s size. It simple stayed in the old size and the scrollpane didn’t start scrolling. And so some items of the tree were invisible.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;nc&quot;&gt;TreeModel&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;model&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;DefaultTreeModel&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;JTree&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tree&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;JTree&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;model&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;setPreferredSize&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Dimension&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;));&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;JScrollPane&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pane&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;JScrollPane&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tree&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The model fires an TreeModelEvent (DefaultTreeModel.nodeStructureChanged) and the tree get’s an JTree.treeDidChange() so it can recompute it’s size.
This doesn’t work out. It was necessary to set the preferred size of the tree to null before excecuting treeDidChange…
Why? I honestly don’t know…&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>VOIP for GNOME Desktop: Ekiga</title>
   <link href="/2009/10/voip-for-gnome-desktop-ekiga.html"/>
   <updated>2008-03-26T00:41:00+01:00</updated>
   <id>/2009/10/voip-for-gnome-desktop-ekiga</id>
   <content type="html">&lt;p&gt;Yesterday I got some time to start playing with SIP. I used &lt;a href=&quot;http://ekiga.org&quot;&gt;Ekiga&lt;/a&gt; a SIP client for the gnome-desktop. After installation I got an account on &lt;a href=&quot;http://ekiga.net&quot;&gt;ekiga.net&lt;/a&gt; and everything went fine. The provided configuration wizard is really cool stuff. The hole action consumed 10 minutes and afterwards I spent 1 hour to get the sound devices working. And it did, but it was really annoying. The only problem now is that my built-in (Thinkpad X60) microphone produces a feedback if I use the internal speakers. The only solution is to use headphones and don’t type or click during a call.&lt;/p&gt;

&lt;p&gt;At last: &lt;a href=&quot;sip:500@ekiga.net&quot;&gt;sip:500@ekiga.net&lt;/a&gt; is a echo service, so you can test your configuration. Next week I will try to get my bluetooth headset running.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>JAX-WS: ORA-31011</title>
   <link href="/2009/10/jax-ws-ora-31011.html"/>
   <updated>2008-01-29T00:42:00+01:00</updated>
   <id>/2009/10/jax-ws-ora-31011</id>
   <content type="html">&lt;p&gt;Today, I tried to do something useful for my bachelor thesis. I tried to query a Oracle 11G DBMS via a SOAP-based Webservice. Using the instruction from &lt;a href=&quot;http://andreatech.blogspot.com/2008/01/oracle-11g-native-webservices.html&quot;&gt;Andrea&lt;/a&gt; and &lt;a href=&quot;http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/xdb_web_services.htm&quot;&gt;Oracle&lt;/a&gt; I got the service up and running. The Webservice was reachable under &lt;a href=&quot;http://localhost:8080/orawsv&quot;&gt;http://localhost:8080/orawsv&lt;/a&gt; and presented it’s wsdl via &lt;a href=&quot;http://localhost:8080/orawsv?wsdl&quot;&gt;http://localhost:8080/orawsv?wsdl&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now the trouble started:
The URL from the Oracle HTTP-Server is secured via HTTP-Authentification. Ok so I downloaded the WSDL and created the stubs from a local file with the JDK’s wsimport. Now I needed to tell the Webservice Client Provider to authenticate if necessary:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;nc&quot;&gt;ORAWSVPortType&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;port&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;ORAWSVService&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getORAWSVPort&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;Map&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Object&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;requestCtx&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;BindingProvider&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;port&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getRequestContext&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;requestCtx&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;put&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;BindingProvider&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;USERNAME_PROPERTY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;user&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;requestCtx&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;put&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;BindingProvider&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;PASSWORD_PROPERTY&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;password&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The first test ended with a desaster:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Exception in thread “main” java.lang.IllegalArgumentException: faultCode argument for createFault was passed NULL
at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl.createFault(SOAPFactory1_1Impl.java:56)
at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:108)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:254)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:224)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:117)
at $Proxy32.xmlFromQuery(Unknown Source)
at productcatalogws.Main.main(Main.java:49)
Java Result: 1&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I couldn’t make anything useful out of these messages. The only thing I found was a dead end: &lt;a href=&quot;http://bugs.sun.com/view_bug.do?bug_id=6587659&quot;&gt;bug_id=6587659&lt;/a&gt;.
So I started debugging:
First view the SOAPMessages:
I used the cool &lt;a href=&quot;http://www.xk72.com/charles/&quot;&gt;charles&lt;/a&gt; proxy.&lt;/p&gt;

&lt;p&gt;Configuration for JAVA:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;nc&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getProperties&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;put&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;proxySet&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;true&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getProperties&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;put&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;proxyHost&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;localhost&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;System&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;getProperties&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;put&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;proxyPort&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;8888&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;After viewing the messages without noticing anything of interesst except:
&lt;em&gt;ORA-31011&lt;/em&gt;: XML parsing error, but without any reference to the Webservice.&lt;/p&gt;

&lt;p&gt;I found a cool tool to use webservices: &lt;a href=&quot;http://www.soapui.org/&quot;&gt;soapUI&lt;/a&gt; (you can do everything I needed using it!!) and queried the Oracle Webservice by hand. And it worked!&lt;/p&gt;

&lt;p&gt;The problem was that the default JAX-WS Provider does send:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;Content-Type: text/xml;charset=”utf-8”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And the Oracle HTTP Server expects:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;Content-Type: text/xml;charset=UTF-8&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;An example SOAPMessage (including the header):&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;Authorization: Basic XXXXX
Host: localhost:8080
Content-Length: 314
SOAPAction: &quot;&amp;lt;a href=&quot;http://localhost:8080/orawsv&quot;&amp;gt;http://localhost:8080/orawsv&amp;lt;/a&amp;gt;&quot;
User-Agent: Jakarta Commons-HttpClient/3.0.1
Content-Type: text/xml;charset=UTF-8
&amp;lt;soapenv:Envelope xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot; xmlns:oraw=&quot;http://xmlns.oracle.com/orawsv&quot;&amp;gt;
    &amp;lt;soapenv:Header&amp;gt;
        &amp;lt;soapenv:Body&amp;gt;
            &amp;lt;oraw:query&amp;gt;
                &amp;lt;oraw:query_text type=&quot;SQL&quot;&amp;gt;SELECT * FROM PRODUCT&amp;lt;/oraw:query_text&amp;gt;
            &amp;lt;/oraw:query&amp;gt;
        &amp;lt;soapenv:Body&amp;gt;
&amp;lt;/soapenv:Envelope&amp;gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The questions are:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Does JAX-WS something wrong during the request or is the DB Webservice the bad guy?&lt;/li&gt;
  &lt;li&gt;And why doesn’t JAX-WS handle the SOAPfault correctly?&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;p&gt;Used software: javac –version:&lt;/p&gt;

  &lt;p&gt;java version “1.6.0_04”
Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode)&lt;/p&gt;

  &lt;p&gt;Oracle 11G DBMS: Oracle Database 11 g Release 1 for 32-bit Windows.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
 </entry>
 
 <entry>
   <title>OpenSSH using Kerberos via GSSAPI</title>
   <link href="/2008/01/openssh-using-kerberos-via-gssapi.html"/>
   <updated>2008-01-01T00:46:00+01:00</updated>
   <id>/2008/01/openssh-using-kerberos-via-gssapi</id>
   <content type="html">&lt;p&gt;I missed to activate a small and tiny feature during the update to Debian Etch: OpenSSH with GSSAPI support.
What does sat mean?&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;g00se.org uses Kerberos for authentification.&lt;/li&gt;
  &lt;li&gt;Kerberos offers Single-Sign-On.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I missed to upload my subversion working copies over ssh without typping my password everytime.
So I installed ssh-krb5 to add the cool behavior.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Cyrus and Exim4 authentification using Kerberos via GSSAPI</title>
   <link href="/2008/01/cyrus-and-exim4-authentification-using.html"/>
   <updated>2008-01-01T00:44:00+01:00</updated>
   <id>/2008/01/cyrus-and-exim4-authentification-using</id>
   <content type="html">&lt;p&gt;Today I used my spare time to let the SMTP and the IMAP server of g00se.org using the GSSAPI for authentification.
The necessary cyrus-sasl libaries were already installed. So I really don’t know which are exactly required. 
I suppose the cyrus-sasl gssapi libary should meet all requirements. 
I needed to install the exi4-daemon-heavy instead of the light one. 
The the heavy one does support authentification using the cyrus-sasl libary.
I created the principals &lt;em&gt;imap/g00se.org&lt;/em&gt; and &lt;em&gt;smtp/g00se.org&lt;/em&gt; and put them into the default keytab.&lt;/p&gt;

&lt;p&gt;And modified the configuration files of both services to let them propose GSSAPI as alternate authentification mechanism:&lt;/p&gt;

&lt;p&gt;(cyrus): imapd.conf:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt; sasl_mech_list: PLAIN GSSAPI
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;and&lt;/p&gt;

&lt;p&gt;(exim4): /etc/exim4/conf.d/auth/01_exim4-config_gssapi&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
10
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt; gssapi_server:
 driver = cyrus_sasl
 public_name = GSSAPI
 server_mech = gssapi
 server_hostname = g00se.org
 #server_realm = G00SE.ORG
 server_set_id = $auth1
 .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
 server_advertise_condition = $\{if eq{$tls_cipher}\{}\{}\{\*}}
 .endif
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Thanks to &lt;a href=&quot;http://blogs.awesomeplay.com/elanthis/archives/2005/02/20/261/&quot;&gt;Sean&lt;/a&gt; for a short and easy description.&lt;/p&gt;

&lt;p&gt;PS: Exim4 does use the splitted configuration file option of Debian.
So you can put the lines anywhere into the authentification section.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Apache with Kerberos authentification</title>
   <link href="/2008/01/apache-uses-kerberos-authentification.html"/>
   <updated>2008-01-01T00:42:00+01:00</updated>
   <id>/2008/01/apache-uses-kerberos-authentification</id>
   <content type="html">&lt;p&gt;Special thanks to the guys who invented &lt;a href=&quot;http://modauthkerb.sourceforge.net/&quot;&gt;mod_auth_kerb&lt;/a&gt;. I removed the PAM authentification modules, which I only used as wrapper to get Kerberos auth through PAM and replaced it with mod_auth_kerb.
Here is the small configuration:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-apache&quot; data-lang=&quot;apache&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt; Krb5Keytab /etc/apache2/krb5.keytab
 KrbAuthRealms G00SE.ORG
 KrbServiceName HTTP
 &lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;Directory&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt; / &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;
&lt;/span&gt;  &lt;span class=&quot;nc&quot;&gt;AuthType&lt;/span&gt; Kerberos
   &lt;span class=&quot;nc&quot;&gt;Require&lt;/span&gt; valid-user
 &lt;span class=&quot;p&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;Directory&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;That’s all! Cool.&lt;/p&gt;

&lt;p&gt;The Firefox bundled into my OpenSUSE 10.3 does already contain all necessary configurations. 
I only needed to add &lt;em&gt;g00se.org *to *network.negotiate-auth.trusted-uris&lt;/em&gt; in &lt;em&gt;about:config.&lt;/em&gt; 
So he does accept the offer to do GSSAPI authentification with these URIS. 
And that’s pretty cool.&lt;/p&gt;

&lt;p&gt;At least I need to figure a way to get my M$ system use such cool stuff.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Exim4 and Saslauthd [service=]</title>
   <link href="/2007/12/exim4-and-saslauthd-service.html"/>
   <updated>2007-12-02T00:47:00+01:00</updated>
   <id>/2007/12/exim4-and-saslauthd-service</id>
   <content type="html">&lt;p&gt;Hello! Since I upgraded g00se.org from Debian Sarge to Etch the authentification mechanism of my exim mail server doesn’t run properly.
I used as I descriped early the saslauthd to authentificate against the pam.
Everything went fine.
I believed, but a few weeks later (I used all the time my &lt;a href=&quot;http://mail.g00se.org/&quot;&gt;webinterface&lt;/a&gt; to send mails.) the exim couldn’t use the same credentials as the imap server.
The saslauthd always claimed that my credentials are false and so exim awnsered with a &lt;em&gt;SMTP Error 535: Authentification failure&lt;/em&gt;. Tonight I managed to look into the problem and it’s source. I checked the saslauthd using &lt;a href=&quot;http://www.penguin-soft.com/penguin/man/8/testsaslauthd.html&quot;&gt;testsaslauthd&lt;/a&gt;.
If I used: &lt;em&gt;testsaslauthd -s smtp -u XXX - p XXX&lt;/em&gt; everything went fine and the saslauthd replied with credentials ok. But if I issued &lt;em&gt;testsaslauthd -s “” -u XXX - p XXX&lt;/em&gt; I got a pam authentification error.
I tried the same using exim and same behavior appeared, exim doesn’t set the name of the service and so all authentification will fail. The problem is that the saslauthd will try to authenticate against a pam configuration which is not available.
Note: I have in /etc/pam.d/ a file called smtp which defines the pam behavior for my smtp service ;).&lt;/p&gt;

&lt;p&gt;The messages (/var/log/auth.log):&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;Dec 3 00:55:50 h1206589 saslauthd[22244]: do_auth : auth failure: [user=XXX] [service=] [realm=] [mech=pam] [reason=PAM auth error]
Dec 3 01:18:45 h1206589 saslauthd[22247]: do_auth : auth success: [user=XXX] [service=imap] [realm=] [mech=pam]&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As you can see the name of the service is in the first log empty.
I found a &lt;a href=&quot;http://www.unixadmintalk.com/f59/exim4-saslauthd-pam_access-doesn-t-work-135526/&quot;&gt;solution&lt;/a&gt;: you can tell the exim how to call the saslauthd.
(Snip of the authentification part of my exim service):&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt; plain_saslauthd_server: 
   driver = plaintext
   public_name = PLAIN
   server_condition = $\{if saslauthd\{\{$auth2}\{$auth3}}\{1}\{0}}
   server_set_id = $auth2
   server_prompts = : .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
   server_advertise_condition = $\{if eq\{$tls_cipher}\{}\{}\{\*}}
 .endif

 login_saslauthd_server:
   driver = plaintext
   public_name = LOGIN
   server_prompts = &quot;Username:: : Password::&quot; # don&apos;t send system passwords over unencrypted connections
   server_condition = ${if saslauthd\{\{$auth1}\{$auth2}}\{1}\{0}}
   server_set_id = $auth1 
   .ifndef AUTH_SERVER_ALLOW_NOTLS_PASSWORDS
     server_advertise_condition = $\{if eq{$tls_cipher}\{}\{}\{\*}}
   .endif
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Now tell exim that he has to use a service attribute for saslauthd change:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;server_condition = $\{if saslauthd\{\{$auth2}\{$auth3}}\{1}\{0}} into server_condition = $\{if saslauthd\{\{$auth2}\{$auth3}*\{smtp}*}\{1}{0}}.
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;smtp have to be the name of the pam configuration file.&lt;/p&gt;

&lt;p&gt;That’s all.
Everythings work as expected.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>JOptionPane and the Focus</title>
   <link href="/2007/11/joptionpane-and-focus.html"/>
   <updated>2007-11-21T00:48:00+01:00</updated>
   <id>/2007/11/joptionpane-and-focus</id>
   <content type="html">&lt;p&gt;I started to write a login screen (NEED: two input field [username, password]and two buttons [ok, cancel]).
Since a login is a blocking panel I created a JPanel and put that on a JOptionPane.showDialog(…). 
Everything looked quite fine, but the default focus was set on the OK-Button. 
So I tried to requestDefaultFocus, but nothing worked. &lt;a href=&quot;http://blogger.ziesemer.com/2007/03/java-password-dialog.html&quot;&gt;Mark&lt;/a&gt; provides a running solution.&lt;/p&gt;

&lt;p&gt;And it works!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>WebSVN vs. ViewCVS</title>
   <link href="/2007/10/websvn-vs-viewcvs.html"/>
   <updated>2007-10-31T00:52:00+01:00</updated>
   <id>/2007/10/websvn-vs-viewcvs</id>
   <content type="html">&lt;p&gt;Tonight I removed ViewCVS and started using WebSVN. It’s nice simple and in PHP :D… &lt;a href=&quot;http://g00se.org/websvn&quot;&gt;Take a look&lt;/a&gt;!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Java Base64 encoding (sun.misc.Base64Encoder)</title>
   <link href="/2007/08/java-base64-encoding.html"/>
   <updated>2007-08-19T23:56:00+02:00</updated>
   <id>/2007/08/java-base64-encoding</id>
   <content type="html">&lt;p&gt;Today I would like to say some words about BASE64 encoding and JAVA. 
Let me introduce a cool class to encode a string: &lt;em&gt;sun.misc.Base64Encoder&lt;/em&gt;
This class seams to work quite all right for some weeks. So, today we transfered our JEE server from a linux to windows (not my idea).
Till now I have assumed that the mythos of the JAVA plattform independence is not only a myth. During the check of the application (the deployed JEE project) it showed up error messages that the base64 coded strings doesn’t match.
On the first look everything seemed to be fine. The second showed up that the strings on the windows machine were one (!) character longer.
Two hours later we found the problem: &lt;em&gt;Does RFC 3548 say something about line feeds and carriage return?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So why does the base64 coded strings contain some?&lt;/p&gt;

&lt;p&gt;The anwser is: Because the &lt;em&gt;encode method of the *Base64Enconder&lt;/em&gt; split the string after some characters (I suppose at char 76 / 77, but I’m not quite sure).
So if you switch the operation system and the new system uses another encoding for the line break, your old base64 encoded data is worthless.&lt;/p&gt;

&lt;p&gt;To solve this problem I used the java mail api (cause JEE server needs to implement these):&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-java&quot; data-lang=&quot;java&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;nc&quot;&gt;StringOutputStream&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;output&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;StringOutputStream&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;OutputStream&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;encoding&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;MimeUtility&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;encode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;output&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;base64&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;encoding&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Hello World&quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;output&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;


&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;java.io.IOException&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;java.io.OutputStream&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;cm&quot;&gt;/**
*
* @author Dennis Guse
*
*/&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;StringOutputStream&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;OutputStream&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;StringBuffer&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;StringBuffer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;StringOutputStream&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{}&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;String&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;();&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;throws&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;IOException&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;char&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;So a half day of work for nothing….
PS: Feel free to use this stuff.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Authentification Server via Kerberos (Heimdal) and LDAP backend</title>
   <link href="/2007/02/authentification-server-via-kerberos.html"/>
   <updated>2007-02-11T00:50:00+01:00</updated>
   <id>/2007/02/authentification-server-via-kerberos</id>
   <content type="html">&lt;p&gt;Today morning I configured heimdal KDC and as storage the openldap slapd. Slapd stores the user information and holds the kerberos authentification information. 
The public URI is ldaps://g00se.org. Kerberos realm: &lt;em&gt;G00SE.ORG&lt;/em&gt;. KDC: &lt;em&gt;g00se.org&lt;/em&gt; The openldap server uses TLS and authenfication and authorisation with the SASL GSSAPI (package (debian): libsasl2-modules-gssapi-heimdal).
First I installed slapd (slapd and the above package). 
Added the krb5-kdc.schema. 
Configurated SASL support and added authorisation rules. 
With &lt;em&gt;slapadd -f “backup.ldif”&lt;/em&gt; 
I installed my backup (without internal kerberos accounts). 
Modified &lt;em&gt;/etc/default/slapd&lt;/em&gt; to let the slapd listen on ldaps:// and ldapi://. 
Reload the configuration.&lt;/p&gt;

&lt;p&gt;Second I installed the heimdal-kdc. Configured the realm. Configured database backend to use the ldapi:// socket and reload it.
Init the realm and create necessary kerberos host accounts (with random keys): &lt;em&gt;kadmin -l&lt;/em&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt; init G00SE.ORG 
 add -r host/g00se.org 
 ext_keytab host/g00se.org 
 add -r ldap/g00se.org 
 ext_keytab ldap/g00se.org
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Reload everything and the authenfication server was up and running!
Have a nice one!!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Authentication client via Kerberos (Heimdal) and LDAP backend</title>
   <link href="/2007/02/authenfication-via-kerberos-heimdal-and.html"/>
   <updated>2007-02-11T00:49:00+01:00</updated>
   <id>/2007/02/authenfication-via-kerberos-heimdal-and</id>
   <content type="html">&lt;p&gt;To use the provided authenfication mechanism from g00se.org on g00se.org :D.
I installed &lt;em&gt;libpam-heimdal&lt;/em&gt; and configured &lt;em&gt;nss&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Kerberos configuration: &lt;em&gt;/etc/krb5.conf&lt;/em&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
10
11
12
13
14
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt; [libdefaults]
 default_realm = G00SE.ORG
 default_keytab_name = /etc/krb5.keytab
 ticket_lifetime = 28800
 default_etypes = des3-hmac-sha1 des-cbc-crc des-cbc-md5
 default_etypes_des = des3-hmac-sha1
 des-cbc-crc des-cbc-md5
 
 [realms]
 G00SE.ORG = { kdc = g00se.org admin_server = g00se.org }
 
 [domain_realm]
 g00se.org = G00SE.ORG
 .g00se.org = G00SE.ORG
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;The pam configuration to use the heimdal KDC: &lt;em&gt;/etc/pam.d/kerberos&lt;/em&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-text&quot; data-lang=&quot;text&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt; #@include common-auth
 #@include common-account auth required pam_krb5.so account required pam_krb5.so
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Configuration of the nss-ldap plugin: &lt;em&gt;/etc/libnss-ldap.conf&lt;/em&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-c&quot; data-lang=&quot;c&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
10
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt; &lt;span class=&quot;n&quot;&gt;uri&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ldaps&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;//g00se.org/&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;ldap_version&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;base&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;dc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;g00se&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;org&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;scope&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sub&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;pam_filter&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;objectclass&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;account&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;pam_login_attribute&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;uid&lt;/span&gt; 
 &lt;span class=&quot;n&quot;&gt;pam_min_uid&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1000&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;pam_max_uid&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2000&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;nss_base_passwd&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ou&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;People&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;g00se&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;org&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;one&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;nss_base_group&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ou&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;group&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;g00se&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;org&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;?&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;one&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Let nss know that there is a second source which provide authorisation data.
&lt;em&gt;cat /etc/nsswitch.conf&lt;/em&gt;&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-c&quot; data-lang=&quot;c&quot;&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt; &lt;span class=&quot;nl&quot;&gt;passwd:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;compat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ldap&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;group&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;compat&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ldap&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;That’s all! As &lt;em&gt;root&lt;/em&gt; you can now check if everything runs: &lt;em&gt;getent passwd&lt;/em&gt; and you will see all your local accounts and the provided central ones! I hope everything is cool!!!&lt;/p&gt;
</content>
 </entry>
 
</feed>
