AI & IT UG - Weblog
15.10.2020 8:26
ad : adimat

Preprint of dissertation thesis

Ten days ago I submitted my dissertation thesis to the TU Darmstadt university. While the official publication is pending, I'll make preprint available here.

04.05.2020 18:20
parser : r2x : xml

A star is born

As our first contribution in the open source software of the world we would like to present R2X: A seamlass XML to R converter. Install with

devtools::install_github("rainac/r2x")

Then you can create XML from R with

R
library(r2x) xml <- r2x( list( a = list(b = 1), a = list(bb = 2), a = list(cc = 3) ) )
<r2x ><a ><b >1</b></a><a ><bb >2</bb></a><a ><cc >3</cc></a></r2x>
29.01.2019 20:48
adimat : ad

New version of ADiMat released

The new version 0.6.6 of ADiMat has been released. New functions now being supported are "conv", "fftshift", "ifftshift" and, for Octave, "prepad", "postpad", and "fftconv".

Have fun differentiating.

10.01.2019 20:44
R : ad

R/ADR: AD tool for the R language

I have completed over the holidays the first version of a new AD tool, this time for the R language: R/ADR. Have a look at the homepage www.r-adr.de. The corresponding R package, called adr, is available from the download page.

R/ADR is very similar in structure to ADiMat. The server at r-adr.de host a transformation service which provides the transpiler part of the tool. The adr package provides a set of necessary runtime functions and utilities for ease of use. The main driver function to use is called adrDiffFor, so it should immediately feel familiar to experienced ADiMat users.

The main distinction, and probably a huge convenience, of doing AD on R vs. AD on MATLAB is that there is no difference between functions and function handles. To reflect this, R/ADR provides the d operator which differentiates R functions.

R/ADR currently supports the forward mode only, but the reverse mode and forward-over-reverse mode for second order derivatives (Hessians) will hopefully follow soon. Drop me a line if you are interested in using it, this would help me in adjusting the priority level of the further development.

14.11.2018 18:20
parser : p2x : xml

New version of P2X released

A new version 0.6.4 of my P2X parser software has been completed and is available from GitHub. The big improvement is the support for line comments and block comments. These define chunks of text that are inserted as "Ignored" items into the tree, i.e. without affecting its structure. This feature is almost indispensable for any attempt to parse real-life programming languages with P2X.

Another crucial enhancement are the two special options to ignore certain items conditionally based on the context. With the new ignoreAfter rule P2X can handle line-broken code in MATLAB, by ignoring the next NEWLINE after the triple dot ... line continuation token. With the ignoreIfStray option P2X can handle line-broken statements in R, by ignoring NEWLINE when it occurs immediately after a binary operator.

07.11.2018 23:00
ad : adimat : hessian

Talk on ADiMat in Zurich

Last week I had the pleasure to hold a talk on "Introduction to Automatic Differentiation for MATLAB (ADiMat)" at the seminar Advances in Computational Economics and Finance of the Chair of Quantitative Business Administration at the University of Zurich.

For the record, here are the slides. I think they make for quite a good and concise introduction to ADiMat, in particular when you are interested in constraint optimization and the evaluation of Hessians.

12.02.2018 19:54
ad : adimat : ode

Techreport on ODE derivatives released

I have a report covering the evaluation of derivatives of an ODE with ADiMat. It is published at Arxiv, here: http://arxiv.org/abs/1802.02247. The two main topics are a) the derivatives of an ODE system and b) how to override the automatic derivates generated by ADiMat for an arbitrary function in the user code. As an exmple I took the well-known Lotka-Volterra equations.

18.10.2017 20:50
orgmode : publishing : www

Website relaunch take two

I am relaunching my personal website again, again from org-mode files, but this time using my own tool which I built on top of org-to-xml.

27.09.2017 20:39
adimat : ad

New version of ADiMat released

The new version 0.6.2 of ADiMat has been released. Some new functions are now supported, for example "legendre", but primarily this is a maintenance release. Several of the outstanding bugs have been fixed.

The server has been updated to use TLS but a problem with the SHA1 signature of the certificate remains. To access the transformation server website https://adimat.sc.informatik.tu-darmstadt.de/ with Firefox, for example, click "Advanced" and then "Add Exception...".

Have fun differentiating.

02.06.2015 19:40

New job at fionec GmbH

I have taken up a new position at fionec GmbH, a company which produces high-precision fiber optic distances sensors. These allow for contactless scanning of almost any kind of surface with a precision of a couple of nm.

19.02.2015 14:44
parser : xml : p2x

New version of P2X released

I have just released a new version 0.4.0 of the P2X light-weight parser with XML output. The main improvement is that there now is complete support for the UTF-8 encoding. In particular, identifiers can now have arbitrary charachters. For example, if you execute

sh
echo "øłð ñ€W" | p2x

you now get in the output two identifiers, as expected:

xml
<op line='1' col='6' code='71' type='JUXTA'> <id line='1' col='0' code='31' repr='øłð' type='IDENTIFIER'> <ca:text>øłð</ca:text> </id> <op line='1' col='6' code='70' type='SPACE'> <ca:text> </ca:text> </op> </op> <id line='1' col='7' code='31' repr='ñ€W' type='IDENTIFIER'> <ca:text>ñ€W</ca:text> </id>

The other major change is the license, P2X is now distributed under the GPLv3 license.

08.12.2014 10:26
www : orgmode : publishing

Relaunching my website

I have recreated my website using, as you can see very tinily at the bottom of the page, o-blog. Now I can edit the content of this entire site in a single file, including both the fixed pages and my blog articles. A single Emacs function converts it all to a bunch of static files which I can push on the server. I did not change much of the design because I don't have the time to spare right now.

04.12.2014 15:06
xml : xmlsh : xslt : xpath : java

xmlsh

I recently found xmlsh and decided to give it a try in spite of it not being available as a Debian package. I like the approach to make the whole thing look like a Unix shell. Here is an example what you can do with it: I run a system command, here echo -n "a+b" | p2x -bPLUS, and get the result in an XML variable, and then extract some subtree from it with XPath.

sh
xmlsh <<EOF x=$<(echo -n "a+b" | p2x -bPLUS) declare namespace cx=http://johannes-willkomm.de/xml/code-xml/ xecho \$x | xpath "/*/cx:root" EOF
Example
$ x=$<(echo -n "a+b" | p2x -bPLUS) $ declare namespace cx=http://johannes-willkomm.de/xml/code-xml/ $ xecho $x | xpath "/*/cx:root" <root xmlns="http://johannes-willkomm.de/xml/code-xml/" line="0" col="0" code="27" type="ROOT"> <null/> <op line="1" col="1" code="47" type="PLUS"> <id line="1" col="0" code="31" repr="a" type="IDENTIFIER"> <ca:text xmlns:ca="http://johannes-willkomm.de/xml/code-xml/attributes/">a</ca:text> </id> <ca:text xmlns:ca="http://johannes-willkomm.de/xml/code-xml/attributes/">+</ca:text> <id line="1" col="2" code="31" repr="b" type="IDENTIFIER"> <ca:text xmlns:ca="http://johannes-willkomm.de/xml/code-xml/attributes/">b</ca:text> </id> </op> </root> $

However, I miss many of my zsh hotkeys, so I will not make xmlsh my default command shell. But I will certainly use it for scripting XML pipelines.

28.11.2014 12:16
xml : emacs : orgmode : publishing

org-to-xml and org-letter

I created two extremely tiny software projects on githup: org-to-xml and org-letter. One of which is a rip-off, and that is the first: the code of org-to-xml, specifically the code in the org-to-xml.el file, was initially posted on stackexchange, in an answer by user harpo to the question "emacs-org mode and html publishing: how to change structure of generated HTML" by user David Belohrad. I grabbed it from there and changed one or two things so that it works with my Emacs 24.

The second is what I actually wanted to do: generate letters from an org-mode file, using HTML as style or template. To this end i export the content of the org-mode buffer to XML and then process it and the HTML template with XSLT to produce the HTML result. This lets me design my template as is, by editing the plain HTML, with some demo texts and style it with CSS. I give certain elements special meanings, basically the will be replaced by some content from the org-mode file. Obvious candidates are keywords

Example
#+keyword: value 1 2 3

and drawers

Example
:drawer: text a text b :end:

In my setup, and in the example i use a drawer for the address and otherwise keywords. By expending even two stylesheets, i can specify the name of the template to use in the org buffer with a keyword. The first stylesheet simply spits out the value of the keyword and the second then run the actual stylesheet against the HTML template thus selected and the org-to-xml result. Thus i can easily switch between official and personal templates, which are the two i mainly need.

The "main" XSLT stylesheet then treats the "main" content of the buffer and converts it to HTML, using simple rules, though basically only paragraphs, sections and lists are handled currently. Many other features are still lacking. That will be a work in progress.

04.11.2014 15:06
emacs : website

Mastering Emacs

I'm using Emacs for a long time now, but I noticed one problem: I tend to stick with the things I know and only rarely discover any new functionality.

Now I found this site with lots of articles about Emacs' special features:

http://www.masteringemacs.org/

24.10.2014 11:20
music : home_entertainment

Goodbye XBMC/Kodi/Yatse, Hello mpd/mpc

While the recent rename of XBMC to Kodi did really not raise any of my eyebrowse, the question was resolved for me another way: Before the rename reached the package name of my preferred OS, Debian testing, it stopped working altogether. Reason: My cupboard laptop does not have a graphics card that is supported. Which is a pity, as it did work just before the update. My usage scenario is as follows: start XBMC and close the Laptop, then listen music via the home stereo and remote control XBMC with Yatse. So I'm not interested in graphics at all. But, searching the web quickly made the ugly truth appearent, it will not work without a nice graphics adapter. The minimum requirements are shown here. Which shows us once more that monolithic systems are bad, if not outright evil. Why should the machine that must just decode the files and sent the audio to the jack have a graphics card?

Replacements, any?

Then started the look for a replacement. Google for XBMC alternatives. Found this list of music players, home media centers, etc. with the usual nice little icons indicating support for Linux, Windows, and Mac. But the main question for me is: Does it exist as a package in Debian testing? The usual suspects. Some new faces. For example Enna. Looks nice but not quite what I want.

Then I found it: mpd. How? Well, I typed into Google the search term linux music player remote control and the top result was this page: http://www.instructables.com/id/Linux-music-server-controlled-by-an-Android-device/ Another example how good Google can work sometimes. In the last few years I started using DuckDuckGo as often as possible. This means, whenever I feel there is a good chance that the Duck will find what I am looking for. Which is the case for example when I look for something on stackoverflow. However, whenever I have a really complicated search task, or maybe semantically challenging, I tend to go to Google directly. Of course you sometimes need good intuition to ask the right question, which in this case I luckily did.

Setting up mpd

On my work laptop mpd was set up very easily:

  • install mpd and mpc

    sh
    sudo aptitude install mpd mpc

    mpd is the daemon and mpc is a console client program

  • Edit file:/etc/mpd.conf and change the setting for the music directory

    Example
    music_directory "/home/user/Music"
  • Restart mpd

    sh
    sudo service mpd restart
  • To update the library, you can use mpc

    sh
    mpc update
  • For remote access, you must also change the TCP listen address in file:/etc/mpd.conf, for example:

    Example
    bind_to_address "0.0.0.0"

    This allows anyone to connect to the MPD, so this is for a home network only

On my cupboard laptop I needed to figure out the correct setting for the device setting in the audio_output section for ALSA before I could hear anything. It now looks like this:

Example
audio_output { type "alsa" name "My ALSA Device" device "hw:1,0" }

I had to more or less guess and piece together this setting from other examples I saw on the net and by looking at the output of the command aplay -l on my computer. Is there any command that prints the available ALSA devices in the form as in the MPD config?

Using mpd

With mpc

Using mpd with mpc is as easy as

sh
mpc search artist garret album vs | mpc add

which adds the tracks of David Garrett's Garrett Vs. Paganini album, but not the Devil's Violinist soundtrack to the playlist, followed by

sh
mpc play

which starts playback.

With GUI programs

There is a whole series of GUI programs for managing an MPD server, music playlists, etc. I did not have the time to try them all. Have a look at http://mpd.wikia.com/wiki/Clients.

From a remote computer

On another computer, just set MPD_HOST to the server name where mpd is running:

sh
export MPD_HOST=family_server

and then mpc can be used exactly as on the server.

As a streaming service

In file:/etc/mpd.conf (on the server) just uncomment and edit the audio_output section for the builtin streaming server, for example like this

Example
audio_output { type "httpd" name "My HTTP Stream" port "8987" bind_to_address "0.0.0.0" bitrate "128" format "44100:16:2" }

Then you can open the URL http://family_server:8987 with an audio player such as Audacious.

With MPDroid

MPDroid is an app which allows remote control of and streaming from an mpd server, though there seem to be several others. It works just great as a remote control and with the streaming feature I can also hear the music on the phone.

There are many other MPD-related apps in the stores, however. Have a look at http://mpd.wikia.com/wiki/Clients.