Blog

  • this seems to be a “LinkedIn Day”

    There are calm days, and there are awfully calm days, this one is not – like half a dozen of “friends” today confirmed my add for them resp. requested me to confirm their add.

  • Mac OS X screen lock image – how to replace?

    I have no idea, how to achieve that. Anybody any idea?

  • DocBook Berlin – created the Google Group for the 1st regional DocBook User Group

    I am very excited about this.

    There is an exploding number of web views on that Google Group.
    Keep your fingers crossed, that there will be frequent activities soon.

    DocBook Website is going to revolutionise the activities necessary to set up static and almost static web-sites, it will not stay the gold mine for a few – it will be affordable for the many.

    DocBook Slides is the new way to create slides, forget everything before!

    Tell everybody about this user group in Berlin! Join “us” for learning and helping each others!

  • how to browse music?

    Today resp. just now I found “yet another time …“, that browsing my music library in iTunes / on the iPod / on the iPhone “by genre” is much more fun, then browsing by name on my file system – what a surprise!
    Yet I still insist, that my music library has to be kept “by name” on the file system. Quite a contradiction, isn’t it?!? But browsing a huge amount of music, with lots of covers included, that definitely is fun. Have a nice weekend, all of you out there …

  • editing XML documents in emacs using nxml-mode

    One good reason for not not authoring in XML is not having a suitable editor or IDE. I personally use and recommend emacs and James Clark‘s nxml-mode. I create and modify all sorts of XML documents this way. If you supply nxml-mode with the right schema for your document, nxml-mode can even help you with tag completion and document validation. nxml-mode makes use of schemas in RELAX-NG, co-created by James Clark. RELAX-NG schemas are rather easily created, if not yet just available, as for DocBook, DocBook Website, DocBook Slides, and many, many other XMLs.

    Trang” is your tool for creating a RELAX-NG schema:

    • if you want to convert a DTD into a RELAX-NG schema,
    • if you want to derive a RELAX-NG schema from a couple of XML files of a specific kind,

    I have done that a dozen times, it does work.

    Here you find nxml-mode’s manual page.

    Your mileage may vary …
  • DocBook Slides

    • If you really are into XML,
    • if you even write your documents in XML ie. DocBook,
    • then you will love DocBook Slides

    The Slides Document Type is an XML vocabulary derived from
    DocBook. It is used to create presentations (slides, foils, whatever
    you call them) in HTML or print.

    Presentations are by nature
    visual and the Slides stylesheets
    provide a wide range of options to control how the transformation from
    XML to HTML is performed.


    One good reason for not not authoring in XML is not having a suitable editor or IDE.

      I personally use and recommend emacs together with James Clark’s nxml-mode. Your mileage may vary though …
    • want to get signalled, when a command line job on your computer is done?

      I have a long list of cpanm jobs,
      don’t want to put them in a batch all toghether,
      and want  to get signalled, when each of them is done:

      $ while true; do beep; done

      In my case the beep is acutally just the flashing of an xterm window.

      Update:
      Yes, notify-send is far, far, far superiour, growlnotify on OS X.
      Thanks for the pointers!

    • GNU Coreutils “seq”

      the manual page.

      Why do I keep forgetting the name of this wonderful little helper?

      seq prints a sequence of numbers to standard output. Synopses:

           seq [option]... last
           seq [option]... first last
           seq [option]... first increment last
      

      seq prints the numbers from first to last by increment. By default, each number is printed on a separate line. When increment is not specified, it defaults to ‘1’, even when first is larger than lastfirst also defaults to ‘1’. So seq 1 prints ‘1’, but seq 0 and seq 10 5 produce no output. Floating-point numbers may be specified (using a period before any fractional digits).

    • best practices in shell script programming – colons

      My snipplet for an if/then/else in shell scripts looks like this:

      if true

      then :

      else :

      fi

      The colons make that code syntactically complete, w/o the colons you run into a syntax error. The colon is the “null op” of (Bourne) shell scripting.
      And the colons usually remain there for the remainder of the life of that code.
      Have you noticed, that the youngsters, that talk about snipplets nowadays seriously think, they invented them? True, I guess, they created the term. Just the term.

    • best practices in shell script programming – double quotes

      You do know the result of this:

      a=A; echo $a

      But are you just as sure here?

      a=A; b=B; echo $a.$b

      That depends on the shell, you are using. So I suggest you better write it this way:

      a=A; b=B; echo ${a}.${b}

      Enclosing variable names in curly braces is quite often a good idea.
      Look at the following piece of code:

      case $var in

        x*)

          echo var starts with x

          ;;

        *)

          echo var starts with something else

          ;;

      esac

      Looks alright, doesn’t it?
      No, it’s does not. If that variable had not been assigned a value before or is of zero length, you will see an ugly syntax error occur.
      Therefore enclose the variable in double quotes like here:

      case “$var” in

        x*)

          echo var starts with x

          ;;

        *)

          echo var starts with something else

          ;;

      esac

      There is no good excuse for not doing it anywhere. It may look ugly and unnecessary, but it will help. That’s the way shell scripting is. I learned this from Jürgen Gulbins around 1987, when I enjoyed working for him. This series of articles is dedicated to him. I owe him a lot.