Download files recursively with wget

With wget you can download files directly in a shell. If you want to download a whole site, known as downloading recursively, you can set the r option.

wget -r http://inkscape.gristle.org

By default wget respects the robots file and thus only downloads the non-private files. The protocol of the robots exclusion standard is pure advisory, this means that the robots.txt contains rules that a search engine or other robots are not allowed to access certain files but they might ignore them.

Wget can be adviced to ignore that rules and thus it downloads the private files anyway. Set the e option as shown next.

wget -e robots=off -r http://inkscape.gristle.org

Other useful commands can be found here:
http://slopjong.de/2009/01/25/useful-mac-commands

DeliciousDiggTechnorati FavoritesRedditLinkedInFacebookSpurlTwitterWebnewsYiGGMySpaceYahoo BookmarksFriendFeedGoogle BookmarksLiveJournalShare

How does channel coding work using hamming codes?

In telecommunication and information theory, channel coding, also known as forward error correction (FEC), is a system of error control for data transmission, whereby the sender systematically adds redundant data to its messages, also known as an error-correcting code (ECC). The American mathematician Richard Hamming pioneered this field in the 1940s and invented the first FEC code, the Hamming (7,4) code, in 1950.1

As a showing example in a communication between two nodes, e.g. two computers, it can happen that the data get corrupted which means that one bit flips from 0 to 1 or from 1 to 0 due to electromagnetic fields or other physical disturbances. Channel encodings like the hamming code help us to avoid data loss or retransmissions due to transmission errors which occured on the way from the sender to the receiver and give the receptor the possibility to correct faulty bits directly as they arrive.

Beside the hamming algorithm there are other encodings of which some will be discussed in other articles coming at a later time. In this article you will learn how to calculate the redundancy bits using the hamming algorithm and how one-bit errors are detected and corrected. The howto is divided into three sections, the first describes how the hamming code is generated, the second briefly describes the transmission and the third is about detecting and correcting bit errors.

Continue reading »

DeliciousDiggTechnorati FavoritesRedditLinkedInFacebookSpurlTwitterWebnewsYiGGMySpaceYahoo BookmarksFriendFeedGoogle BookmarksLiveJournalShare

Invalid MIT-MAGIC-COOKIE-1 key

Recently I couldn’t start the x server and I got a mysterious Invalid MIT-MAGIC-COOKIE-1 key error. I deleted the .Xauthority files in my home directory which fixed my problem.

rm ~/.Xauthority*
DeliciousDiggTechnorati FavoritesRedditLinkedInFacebookSpurlTwitterWebnewsYiGGMySpaceYahoo BookmarksFriendFeedGoogle BookmarksLiveJournalShare

Install the java plugin in firefox

To install the Next-Generation Java plugin in firefox follow the instructions below which is a summary of this article. If you have been using the classic plugin, see the Notes for further information.

  1. Check if you’re using the 32-bit firefox. Select the menu item Help -> About Mozilla Firefox. At the bottom of the window is a version string line that contains either “Linux i686″ (32-bit) or “Linux x86_64″ (64-bit). If you use the 64-bit version have a look at this blog post else continue.
  2. Exit Firefox.
  3. Change to ~/.mozilla/plugins or to another firefox plugins directory.
  4. Remove all symlinks (or move them to another directory).
  5. Create a symlink for the 32-bit plugin. Execute one of the following lines
    ln -s ${JRE_HOME}/lib/i386/libnpjp2.so
    ln -s ${JAVA_HOME}/jre/lib/i386/libnpjp2.so

    depending on what environment variable you have set. If you don’t know where your java is located find it out with which java or locate java

  6. Start firefox.
  7. Type about:plugins in your location bar to confirm that the java plugin is loaded.
DeliciousDiggTechnorati FavoritesRedditLinkedInFacebookSpurlTwitterWebnewsYiGGMySpaceYahoo BookmarksFriendFeedGoogle BookmarksLiveJournalShare

Run a JavaFX application

Oracle claims that

JavaFX applications will run on any desktop and browser that runs the Java Runtime Environment …

but if I try to run it with my jre I get this error:

java de.slopjong.App
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/javafx/runtime/FXObject
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Caused by: java.lang.ClassNotFoundException: com.sun.javafx.runtime.FXObject
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        ... 12 more
Could not find the main class: de.slopjong.App.  Program will exit.

If I’m not wrong this means that a JavaFX application requires more than just the Java Runtime Environment. Somewhere else in the JavaFX documentation I read that it’s compiled into java byte-code but this seems to be not the whole story. I understood this as you can run a JavaFX application with your standard jre.

Why should I use JavaFX for graphical user interfaces if the users must have the JavaFX libraries on their computer? I don’t want to force them to install one more piece of junk!

DeliciousDiggTechnorati FavoritesRedditLinkedInFacebookSpurlTwitterWebnewsYiGGMySpaceYahoo BookmarksFriendFeedGoogle BookmarksLiveJournalShare